如何将 JavaScript 添加到电子邮件中?
电子邮件中是否可以有 ajax 按钮? 我想添加一个类似于 Google 日历会议邀请电子邮件中的按钮的按钮。
或者还有其他选择吗???
Is it possible to have a ajax button inside email?
I want to add a button similar to the buttons inside a google calendar meeting invitation email.
Or is there any alternative option???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不要指望它。大多数(如果不是全部)邮件客户端都会拒绝在电子邮件中运行 Javascript。
如果您想包含按钮,请插入带有不同链接的图像到您的公共网页。另外,请在邮件消息本身中包含按钮图像(并通过 Content-ID),因为现在许多邮件客户端甚至拒绝加载远程图像。
这正是 Google 日历的作用。当然,Gmail 可以识别邀请附件 (text/calendar),因此提供了自己的界面对于是/否/也许按钮。
Don’t count on it. Most if not all mail clients will refuse to run Javascript within an e-mail.
If you want to include buttons, insert images with different links to a public web page of yours. Also, do include the button images within the mail message itself (and reference them by Content-ID), since many mail clients nowadays even refuse to load remote images.
This is exactly what Google Calendar does. Of course, Gmail recognizes invitation attachments (text/calendar), and so provides its own interface for the yes/no/maybe buttons.
可能不是,这取决于邮件客户端,但如果我看到任何允许脚本的东西,我会感到非常惊讶,因为这打开了巨大的安全危害风险的闸门。
编辑
您最好的选择可能是查看对 iframe 的支持,不过,如果许多邮件客户端允许使用此元素,我会感到惊讶。
Probably not, it depends on mail client but I would be incredibly suprised if I saw any that allowed scripts as this opens the floodgates for huge security compromise risks.
Edit
Your best option would probably be to look at support for iframes, again though, I would be suprised if many mail clients allowed use of this element.