いくつかの画像が埋め込まれた電子メール ニュースレターをプログラミングしています。ヘッダーは次のようになります。
... (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 で完全に表示されます... しかし、もちろん、インライン画像を追加することはできません。