且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Base64 编码的图像未在 gmail 中显示

更新时间:2022-12-03 11:37:41

base64 编码的图像在电子邮件中没有得到很好的支持. 大多数网络电子邮件客户端(包括 Gmail)不支持它们并且是在 Outlook 中完全被阻止.Apple Mail 是为数不多的确实支持它们的客户端之一,这就是为什么你可以在那里看到它们但在其他地方看不到的原因.

base64 encoded images are not well supported in email. They aren't supported in most web email clients (including Gmail) and are completely blocked in Outlook. Apple Mail is one of the few clients that does support them, that's why you're able to see them there but not elsewhere.

使用 base64 编码图像要注意的另一件事是电子邮件文件的大小.Gmail 应用程序(iOS、Android)和 Outlook (iOS) 会截断文件大小超过 102KB 的电子邮件.远程引用的图像(例如 <img src="http://www.website.com/image.png"> 不计入电子邮件的文件大小,但 base64 编码图片,并且可以快速将电子邮件的文件大小超过 102KB 限制.只是需要考虑的其他事项.

Another thing to be mindful of with base64 encoded images is email file size. Gmail App (iOS, Android) and Outlook (iOS) truncate email messages whose file size exceeds 102KB. Remotely referenced images (Eg. <img src="http://www.website.com/image.png"> do not count towards the email's file size, but base64 encoded images do and can quickly blow out an email's file size past the 102KB limit. Just something else to consider.