讓 Email 同時提供 text/plain 跟 text/html 版本,讓不支援 HTML 的 Email client 也可以顯示 plain 是一種是具有親和力的作法。根據 multipart-alternative 的定義,正確的格式應該長這樣,用 boundary 分隔成兩個部份:
From: Nathaniel Borenstein <[email protected]> To: Ned Freed <[email protected]> Subject: Formatted text mail MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=boundary42 --boundary42 Content-Type: text/plain; charset=utf-8 ...plain text version of message goes here.... --boundary42 Content-Type: text/html; charset=utf-8 .... html version of same message goes here ... --boundary42--