Most email you send is designed in HTML, yet a message that contains only HTML is a message with one point of failure. Some recipients read mail in clients that show text only, some use screen readers or watch notifications that display a text preview, and some filters regard an HTML-only message with no text equivalent as a small sign of carelessness or of bulk tooling. The remedy is a plain-text alternative: a second version of the same content, carried in the same message, that any client can display. This guide explains how the multipart/alternative structure works, why a text part helps deliverability and accessibility, how to generate or write a good one, which mistakes are common and how to verify the result. It applies to marketing campaigns and to transactional mail alike, and it takes little effort once your sending code or template system produces it by default.
How multipart/alternative works
MIME lets a message contain several parts. In multipart/alternative, each part is a different rendering of the same content, ordered from the simplest to the richest. The receiving client picks the best one it can display, normally the last. See MIME and multipart types for the wider picture.
Content-Type: multipart/alternative; boundary="b1"
--b1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hello Asha,
Your invoice is ready: https://example.com/invoices/123
--b1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<p>Hello Asha,</p><p><a href="https://example.com/invoices/123">View invoice</a></p>
--b1--If the message also has attachments, the usual shape is multipart/mixed containing the alternative block followed by the attachments. Libraries build this for you; the important point is that both parts are present and that each declares its character set. See UTF-8 encoding in email for the charset rules.
Why a text part matters
- Deliverability signals. Content filters compare the parts. A message with HTML and a matching text part looks like mail produced by a mature system, while a message with no text part, or with a text part that says "your email client does not support HTML", looks like generated spam. See how content filters work.
- Accessibility. Screen readers and text-only clients read the text part reliably. Complex table layouts can be tiresome to navigate, while a clean text part is quick to read.
- Previews and notifications. Watches, notification banners and some clients build the preview from the text part. A good text part gives a clear preview. See preheader text.
- Resilience. If HTML is stripped by a security gateway or blocked by user settings, the message still communicates.
- Preference. Some recipients choose plain text deliberately, for speed, security or accessibility, and expect it to work.
What a good text version contains
A good text part is not a dump of the HTML with the tags removed. It is the same message written for a reader who sees only characters:
- The same message in the same order. Headline, body, call to action, footer.
- Full URLs on their own lines so they are clickable and easy to copy. Use the same destination as the HTML link, including any tracking domain you apply to both. See click tracking domain.
- Short lines of roughly 60 to 78 characters when you write by hand, or leave wrapping to the client.
- Meaningful replacements for images. Use the alt text where an image carries meaning, and omit decorative images.
- Simple structure using blank lines, dashes or capital letters for headings, and hyphens for lists.
- The legal footer with sender identity, postal address where required and an unsubscribe link, matching the HTML. See one-click unsubscribe.
Generating the text part
| Approach | How | Best for | Watch out |
|---|---|---|---|
| Automatic conversion | Library converts HTML to text (html2text, html-to-text and similar) | Transactional mail with simple templates | Table layouts can produce odd spacing; check output |
| Separate template | Maintain a text template next to the HTML one | Important transactional messages | Two files must be kept in sync |
| Editor generated | The campaign editor creates a text version | Marketing campaigns | Review it; auto text often contains tracking noise |
| Hand written | Writer composes a text version for each campaign | High-value newsletters and announcements | Takes time but gives the best result |
For code that sends through an API or SMTP, provide both fields explicitly. In most libraries this is a parameter for the text body and another for the HTML body. See sending examples.
# Python: build both parts with the standard library
from email.message import EmailMessage
m = EmailMessage()
m["Subject"] = "Your invoice is ready"
m["From"] = "[email protected]"
m["To"] = "[email protected]"
m.set_content("Hello Asha,\nYour invoice is ready: https://example.com/invoices/123\n")
m.add_alternative("<p>Hello Asha,</p><p><a href=\"https://example.com/invoices/123\">View invoice</a></p>", subtype="html")Common mistakes
| Mistake | Effect | Fix |
|---|---|---|
| No text part at all | HTML-only mail; mild filter penalty and poor accessibility | Always add a text alternative |
| Placeholder text such as "view this email in your browser" | Mismatch with HTML; looks like spam | Write the real content |
| Text part from an old template | Different offer or links than the HTML | Generate it from the same source on every send |
| Different links in text and HTML | Confusing, and can look deceptive | Use the same destinations |
| Wrong charset or missing encoding | Garbled characters in the text view | Declare UTF-8 and encode correctly |
| Parts in the wrong order | Clients show the plain part even though HTML exists | Put text first, HTML last |
| Very long single lines | Unreadable in narrow viewers | Wrap or break at sensible points |
| Tracking pixels represented as text | Stray URLs in the text | Leave the pixel out of the text part |
Special cases
Some messages deserve extra thought. Receipts and invoices often contain tables, and a naive conversion turns them into a jumble of words; format them as aligned lines such as "Item - quantity - price" in the text part. Password reset and one-time code messages should show the code on its own line so that it can be selected easily. Newsletters with many images need a short summary at the top of the text version, since a reader of text alone has no pictures to guide them. Messages in right-to-left languages should be checked in both parts, because direction and punctuation can behave differently. Finally, remember that long tracking URLs make the text part hard to read; where your system allows, use a shorter branded tracking domain on your own domain, not a third-party shortener.
Testing
- Send a test to yourself and view the raw source to confirm that both parts and the boundary exist. See reading headers and source.
- Open the message in a text-only view (most clients offer "view as plain text") and read it as a recipient would.
- Check the preview line in a few clients to see which text is used.
- Run the spam checker; many checkers flag a missing or mismatched text part.
- Add a check to your build or deployment so that a template without a text version fails the test. See staging and testing.
Should you ever send text only?
Yes, for some messages. Personal-style emails, short notifications, one-to-one outreach and plain operational alerts are often best as text only. They are lightweight, render everywhere and need no tracking pixel. If a message does not need layout, do not add it. The key is that the message is complete, whichever format you choose. Where you send HTML, send the text alongside it.
Treat the text part as part of the message, not as an afterthought. A few minutes of attention gives you a version that reads well, helps filters recognise legitimate mail and reaches every recipient, whatever client they use.
Send complete messages from your app Provide both text and HTML parts through the SMTP relay or email API.
References and further reading
Frequently asked questions
Do I need a plain-text part if I send HTML?
It is strongly recommended. It improves accessibility and resilience and avoids a small filter penalty for HTML-only mail.
Which part should come first in multipart/alternative?
The plain-text part first and the HTML part last, because clients prefer the last part they can display.
Can I generate the text part automatically?
Yes, but review the output. Complex table layouts and tracking elements can produce untidy text.
Should the text and HTML links match?
Yes. Use the same destinations so the messages are consistent and not misleading.
When is text-only email a good choice?
For short, personal or operational messages that need no layout and benefit from simplicity.