1

我正在编写带有几个嵌入式图像的电子邮件通讯。标题看起来像:

... (snip)
MIME-Version: 1.0
Content-type: multipart/related;
boundary="xyzzy1220091"

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--xyzzy1220091
Content-type: text/html; charset=iso-8859-1; name="tempE924AAC7.html"
Content-description: html
Content-transfer-encoding: 7bit
Content-disposition: INLINE

(HTML newsletter here)

--xyzzy1220091
Content-type: image/jpeg; name="cabecera.jpg"
Content-description: cabecera
Content-transfer-encoding: base64
Content-disposition: inline; filename="cabecera.jpg";
Content-ID: <cabecera>

这在 Gmail、Hotmail、Apple Mail 中都能正常工作……除了 Outlook 2010 之外,我测试过的所有东西都在其中。在其中,它将显示一条空消息,并将 HTML 和 JPG 文件作为附件显示在单独的选项卡中;如果您单击 HTML,它将向您显示一个预览按钮,其中包含有关仅显示来自受信任来源的预览的警告。

如果我不以多部分/相关附件的形式发送时事通讯,而只是以 HTML 电子邮件的形式发送:

Content-type: text/html
Content-transfer-encoding: quoted-printable

然后它在 Outlook 中完美显示......但当然,我不能添加内联图像。

4

1 回答 1

1

至于原始问题,我通过使用“multipart/alternative”解决了它,而不是将 HTML 部分附加为文件

于 2013-12-05T02:53:15.797 回答