对于 HTML 电子邮件,如何嵌入图像以使用户不会收到下载提示
我正在创建一封包含 2 张图像的 HTML 电子邮件。目前,我正在使用标签将图像放置在电子邮件中。问题是,当用户收到电子邮件时,出于安全原因,它要求用户“单击下载”。
有没有办法将图像嵌入到电子邮件中,以避免此问题?
我正在使用 Coldfusion 发送电子邮件。
谢谢
I'm working to create an HTML email which includes 2 images. Currently, I'm using tags to place the image in the email. Problem is when users get the email, it's asking the user to "click to download" for security reasons.
Is there a way to embed the image in the email, to avoid this issue?
I'm using Coldfusion to send the email.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用
cfmailparam
将图像嵌入为附件,并链接到附件而不是外部文件。http://www. bennadel.com/blog/61-CFMail-CFMAILPARAM-Used-to-Embed-Images-in-Email.htm
You can embed the image as an attachment using
cfmailparam
and link to the attachement instead of an external file.http://www.bennadel.com/blog/61-CFMail-CFMAILPARAM-Used-to-Embed-Images-in-Email.htm
我尚未测试这是否适用于电子邮件客户端,但如果您将图像编码为 Base64,则可以将其包含在 HTML 中,从而避免连接到远程服务器的问题。
以下是使用 CFML 执行此操作的方法:
I haven't tested if this works in e-mail clients, but if you encode the image as Base64 you can include it in the HTML, which avoids the issue of connecting to a remote server.
Here's how you can do this with CFML:
我相当确定这是电子邮件客户端问题,而不是您正在组合的电子邮件/HTML 问题。我不知道(谷歌很快也没有显示)有任何方法可以用 HTML 来解决这个问题。
一种可能的解决方案可能是创建一封富文本电子邮件并将图像嵌入到 RTF 中,不确定这是否能解决您的问题。
其他想法是您必须在电子邮件中包含图片吗?您可能会更好地设计电子邮件格式,使其不依赖图像进行格式化/美观,而是在客户端显示它们时允许将它们包含在内。不确定您的目标受众是谁,但在我的工作中,我们必须经常与仅限于纯文本电子邮件的用户打交道。
I am fairly certain that is an email client issue and not the email/HTML you are putting together. I am unaware (and a quick Google didn't show) of any ways to get around this with HTML.
One possible solution may be to create a rich text email instead and embed the image in the RTF, not sure if that will get you around your issue or not.
Other thought is do you have to have the images in the email? You might be better of crafting the email format to not rely on the images for formatting/aesthetics but allow them to be included if the client displays them. Not sure who your target audience is but in my job we have to deal with users that are restricted to plain text email quite often.