用 HTML 电子邮件发送 base64图像

使用富文本编辑器,用户可以将保存的图像从桌面拖放到编辑器中。该图像出现和显示后,他们提交的网页正确。

由于图像不会上传到任何地方,因此编辑器将图像保存为 base64编码的图像。

<img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA4QAAAFKCAIAAADKUQaBAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAP+lSURBVHhepP1p32zb

等等。

但它并没有出现在 iPhone 上,也没有出现在两个不同版本的 Outlook 上。这画面简直就是破碎的。我们希望坚持使用 base64,因为它已经可以处理网页,并且在用户离线时可以查看图像。

217156 次浏览

Support, unfortunately, is brutal at best. Here's a post on the topic:

https://www.campaignmonitor.com/blog/email-marketing/2013/02/embedded-images-in-html-email/

And the post content: enter image description here

An alternative approach may be to embed images in the email using the cid method. (Basically including the image as an attachment, and then embedding it). In my experience, this approach seems to be well supported these days.

enter image description here

Here's a little more reading: https://sendgrid.com/blog/embedding-images-emails-facts/