简体   繁体   English

动态电子邮件模板到不同的邮件客户端 - PHP

[英]Dynamic email template to different email clients - PHP

I have been searching for answer for a while but i could not find one direct answer. 我一直在寻找答案,但我找不到一个直接的答案。

I am working on a news letter module for a web application built in PHP. 我正在为一个用PHP构建的Web应用程序创建一个新闻信函模块。 Application sends large amounts of emails to users. 应用程序向用户发送大量电子邮件。 I need a way to send different email templates based on device/client user uses to read the email. 我需要一种方法来发送基于设备/客户端用户使用的不同电子邮件模板来阅读电子邮件。 especially mobile clients. 特别是移动客户。

At least I want to distinguish desktop and mobile versions. 至少我想区分桌面和移动版本。 Is there a way for this. 有没有办法解决这个问题。

Isn't Possible. 不可能。 You can't even use javascript to detect the client as far as I know. 据我所知,您甚至无法使用javascript来检测客户端。

In a word no. 一句话没有。 HTML emails are handled by the email provider itself. HTML电子邮件由电子邮件提供商本身处理。 Gmail (for example) as a provider will show content to the end user regardless of the device you are using. Gmail(例如)作为提供商,无论您使用何种设备,都会向最终用户显示内容。

That said if you design your template well enough to be considered "responsive" you can spoof your idea by having automagically shrinking tables. 也就是说,如果你设计好你的模板以便被认为是“响应”,那么你可以通过自动缩小表来欺骗你的想法。

Also no email provider allows javascript in templates for security reasons and very few allow full CSS rules and only support basic CSS 2. 出于安全原因,也没有电子邮件提供商允许在模板中使用javascript,并且很少允许完整的CSS规则并且仅支持基本的CSS 2。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM