How To Build And Send Multipart MIME Messages
In this article Melinda Krueger explains how to build and send Multipart MIME messages.
A multipart MIME message is like a package with multiple boxes within it. In your standard HTML + text message, both types of content are sent in the email. Your email client, assuming it understands MIME format, will decide which of the boxes to open and display to you.
It is up to the mail client to determine which content type to display or how to convert the content and format it for its own display (a la mobile devices). It’s also important to note that there is no standard stating that a message must contain either format or that if they do, each part must contain the same content.
The story you tell with images may be significantly different than
the one you tell without. Don’t short-cut the text version by cutting
and pasting your copy from the HTML version.
How difficult is it to create a multipart MIME message?
For someone with programming skills, it is not difficult. Most
programming languages have facilities for sending multipart MIME
messages. Email Service Providers (ESPs) and email sending software
generally provide the ability to create the most common type of
multipart message. When you send using these tools, as you know, you
define a text version and an HTML version, and, when it sends the email
out, the software combines these into a multi-part message.
From a technical perspective, composing a multipart message is much easier than coding HTML content itself. The main email message headers must contain a header that looks as follows:
Content-Type: multipart/alternative; boundary=”—-_=_NextPart_258_6857422.F4240?
Then each part is simply delimited by the boundary
“——_=_NextPart_258_6857422.F4240? on a single line. (note the two extra
dashes in the beginning).
The last boundary ends with an extra “–” such as “——_=_NextPart_258_6857422.F4240–”.
The boundary string is simply a string of randomly generated characters that should not occur within the content.
Source: MediaPost’s Email Insider


