问题描述
我已经使用 HTML
和从头开始的内联样式创建了电子邮件模板.现在,我需要添加一些图像,这时无法使用url,因为它不是托管的.我尝试使用base64编码,该编码在Apple Mail客户端中有效,但是图像无法在Gmail中呈现.有什么方法可以将图像嵌入所有电子邮件客户端支持的html中吗?
I have created an Email template using HTML
and inline style from scratch. Now I need to add some images, at this point it's not possible to use url because it is not hosted. I tried using base64 encoding, it worked in Apple mail client, but the images are not rendering in Gmail. Is there any way to embed image in html supported by all email clients?
推荐答案
通过共享网络上的公开"或具有链接的任何人"链接在 Google云端硬盘中公开托管图片.然后使用此链接 http://drive.google.com/uc?export=view&id=FILE_ID
来直接访问该图像.您应将 FILE_ID
替换为Google云端硬盘链接中的实际ID.
Host the Image publicly in Google Drive by sharing the link 'public on the Web' or 'anyone with the link'. Then use this link http://drive.google.com/uc?export=view&id=FILE_ID
to get direct access to the image. You should replace the FILE_ID
with actual id from Google Drive link.
示例:
Google云端硬盘链接: https://drive.google.com/open?id=0B7RYx63s2PFqam9PWVFrcXc1RU
Google Drive Link : https://drive.google.com/open?id=0B7RYx63s2PFqam9PWVFrcXc1RU
生成的链接: http://drive.google.com/uc?export=view&id=0B7RYx63s2PFqam9PWVFrcXc1RU
现在您可以在模板中使用此链接.
Now you can use this link in your template.
这篇关于如何在HTML电子邮件模板中嵌入图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!