How are HTML and plain text emails structured using MIME?

Still have a question, spotted an error, or have a better explanation or a source we should cite?

When you send an email, most recipients never think about what's actually traveling to their inbox. But under the hood, that message is often two emails in one: an HTML version and a plain text version, bundled together using a MIME structure called multipart/alternative.

MIME (Multipurpose Internet Mail Extensions) is the format that lets an email carry multiple pieces of content inside a single message. The multipart/alternative type tells the receiving client "here are two versions of the same thing, pick the one you can best display."

Here's what that structure looks like in the raw email source:

Content-Type: multipart/alternative; boundary="----=_boundary"

------=_boundary
Content-Type: text/plain; charset=UTF-8

[Your plain text version here]

------=_boundary
Content-Type: text/html; charset=UTF-8

[Your HTML version here]

------=_boundary--

The boundary string is just a unique separator the sending server invents to mark where one part ends and the next begins. Plain text comes first, HTML comes last. That order matters: email clients are supposed to pick the last version they can render, which is why HTML lands at the bottom (it's the preferred option for modern clients).

When the message arrives, the email client runs through a simple decision. If it can render HTML, it shows the HTML version. If it can't (think older corporate clients, accessibility tools, or users who've turned off HTML for security), it falls back to plain text. No plain text version means no fallback, and some users will see a blank or broken email.

There's also a deliverability angle worth knowing. Some spam filters cross-check the HTML and plain text versions against each other. If one says "50% off your order" and the other is completely empty, that mismatch looks suspicious. You don't need word-for-word identical copies, but the core message should match.

And most ESPs generate plain text automatically from your HTML, which is fine for delivery but often produces ugly output full of link URLs and broken formatting. Writing a short, clean plain text version yourself takes five minutes and makes a real difference for anyone reading it.

How to verify both versions exist in your emails

You can check this by viewing the raw source of any email you send yourself. In Gmail, open the message, click the three-dot menu, and choose "Show original." Look for Content-Type: multipart/alternative and both text/plain and text/html sections. If you only see one content type, your plain text fallback might be missing. You can also use our free Email Header Analyzer to parse the raw source and see what your emails actually contain.

Contributors

Who worked on this answer

Every name links to their profile. Every company links to their site. Real people, real accountability.

Ask an AI · tailored to your setup

Check my multipart structure

My emails use MIME's multipart/alternative structure. Based on my setup below, can you help me check whether my plain text and HTML versions are consistent, identify any content mismatches that might look suspicious to spam filters, and suggest how to improve my plain text version for readability?

Edit the yellow boxes, then send to the AI of your choice.