带有附件的 HTML 电子邮件

发布于 2024-12-16 12:38:01 字数 231 浏览 4 评论 0原文

我的一个朋友希望我帮助他制作一个包含页眉和页脚图像的 HTML 电子邮件模板。

最初我认为创建一个表格 html 电子邮件很容易,该电子邮件在页眉和页脚的标签内使用远程图像,但是大多数电子邮件客户端默认情况下不会显示这些图像。

一位同事提到了 MIME 和 UUEncoding,但是我找不到如何实现这一点的明确示例。

有人可以给我一个提示,告诉我如何实现我想要做的事情吗?

提前致谢

A friend of mine wants me to help him make a HTML email template that contains a header and footer image.

Originally I thought it would be easy enough to just create a tabular html email that used remote images inside tags for the header and footer, however most email clients will not display these images by default.

A collegue has mentioned MIME and UUEncoding, however I cannot find a clear example of how to achieve this.

Could somebody please give me a hint on how I can achieve what it is I am trying to do.

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

可是我不能没有你 2024-12-23 12:38:01

是的,正如 Tripleee 所写,您必须使用一些理解 MIME 的库或客户端。

在多部分/相关 MIME 部分中包含 HTML 正文和引用的图像。

使用 cid 协议引用 HTML 部分中的图像。例如

.

以下是所包含图片的 MIME 标头示例:

Content-Type: image/jpeg; name=logo.jpg 
Content-Transfer-Encoding: base64 
Content-Disposition: inline; filename=logo.jpg
Content-ID: logo

Yes, as tripleee wrote, you have to use some library or client which understands MIME.

Include the HTML body and the referenced images in a multipart/related MIME part.

Refer the images in the HTML part using the cid protocol. For example

<img src="cid:logo">.

Here is an example MIME header for the included picture:

Content-Type: image/jpeg; name=logo.jpg 
Content-Transfer-Encoding: base64 
Content-Disposition: inline; filename=logo.jpg
Content-ID: logo
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文