MIME in email stands for Multipurpose Internet Mail Extensions, a standard that tells email clients and mail servers how to identify, encode, and assemble message content beyond simple plain text. It makes modern email possible by supporting HTML and text alternatives, file attachments, inline images, international characters, and multiple content sections in one message.
MIME is not a deliverability metric, bounce category, or sending rate. Instead, it is message structure: the technical envelope inside an email that describes what each part contains and how a recipient’s email client should interpret it. A well-formed MIME message helps Gmail, Outlook, Apple Mail, and other clients render a campaign or transactional email as intended. A malformed one can cause broken layouts, unreadable characters, missing attachments, spam-like signals, or outright rejection by a receiving system.
What MIME means in email sending
Before MIME, internet email was designed primarily for short messages made of US-ASCII text. That was enough for a basic note containing letters, numbers, and limited punctuation. It was not enough for an email with a styled HTML receipt, a PDF invoice, a French subject line, an inline logo, or a calendar invitation.
MIME extends the standard email format so a message can describe richer content. At its core, MIME answers a few practical questions:
- What kind of content is this?
- Which character set is used to read text?
- Is the content encoded for safe transport?
- Does the message contain multiple versions or multiple files?
- Where does one section of the message end and another begin?
A MIME-capable message can include a plain-text version for compatibility, an HTML version for presentation, and one or more attachments. It can also include embedded images that are referenced by the HTML rather than loaded from an external URL.
The foundational MIME specifications define headers and media types that classify content. In practical email work, that means fields such as Content-Type, Content-Transfer-Encoding, and Content-Disposition are as important to rendering as the HTML itself.
MIME in email versus SMTP, APIs, and message headers
MIME is often confused with SMTP because both are involved in sending email. They solve different problems.
SMTP is the transport protocol used by mail systems to relay a message from a sender toward a recipient’s mailbox provider. MIME describes the content inside that message. An SMTP server can transfer a MIME message, but SMTP itself does not tell a receiving email client how to distinguish an HTML body from a PDF attachment.
An email API plays a similar role to SMTP from an application developer’s perspective. Your application might call an API with fields such as recipient, subject, text body, HTML body, and attachments. The sending platform can then build the correct MIME structure before relaying the message. Alternatively, some providers support sending an already-composed raw MIME message when an application needs low-level control.
The ordinary message headers remain separate from MIME body-part headers. A simplified email has two major areas:
- Message headers, such as
From,To,Subject,Date, andMessage-ID. - Message body, which may itself be a MIME entity with its own headers and content.
A blank line separates the top-level message headers from the body. If the body is multipart, each part has another set of headers followed by that part’s actual content.
That distinction matters when debugging. A display-name problem in From or an incorrectly encoded Subject is a message-header issue. A PDF arriving as a page of unreadable text is more likely a MIME body-part, media-type, or transfer-encoding issue.
The MIME headers that matter most
Most senders do not hand-write every MIME header every day. Email libraries and sending platforms usually generate them. Still, understanding the fields makes it much easier to diagnose rendering problems and safely build special message types.
Content-Type
Content-Type identifies the kind of content in a message or individual MIME part. For text, it commonly also declares a character set.
Examples include:
Content-Type: text/plain; charset=UTF-8
Content-Type: text/html; charset=UTF-8
Content-Type: application/pdf
Content-Type: image/png
text/plain means the part should be displayed as unformatted text. text/html means the part contains HTML markup. application/pdf identifies a PDF attachment. A client uses this information to decide whether to render content directly, download it, preview it, or hand it to another application.
For text email, charset=UTF-8 is the practical default for modern senders. UTF-8 lets the message include names, accents, symbols, and text in many writing systems without substituting corrupted characters. Declaring the charset is not enough by itself: the actual bytes in the body must match the declared charset.
Content-Transfer-Encoding
Content-Transfer-Encoding tells a receiving system how body content was encoded so it could travel through email infrastructure safely.
Common values include:
Content-Transfer-Encoding: 7bit
Content-Transfer-Encoding: quoted-printable
Content-Transfer-Encoding: base64
7bit is suitable for simple ASCII text. quoted-printable is often useful for mostly readable text containing non-ASCII characters or long lines. It keeps much of the content human-readable while representing some bytes with = sequences.
base64 converts binary content, such as a PDF, image, spreadsheet, or audio file, into text characters that can travel safely through systems built around text-oriented message transfer. It increases payload size, so an attachment is larger in transit than the original file. That expansion is normal and should be considered when setting attachment-size limits.
The transfer encoding must match the actual content. Sending raw binary data while labeling it as base64, for example, produces a corrupt attachment. Encoding an HTML part as base64 is allowed, but it can make debugging harder and is usually unnecessary unless a library has a particular reason to do it.
Content-Disposition
Content-Disposition describes how a client should present a MIME part. The common choices are attachment and inline.
Content-Disposition: attachment; filename="invoice-1042.pdf"
Content-Disposition: inline; filename="logo.png"
An attachment is normally shown as a downloadable file. An inline item is intended to appear as part of the rendered message, although clients still apply their own safety and display rules.
The filename parameter is useful to recipients, but filenames require careful handling when they contain non-ASCII characters. Let a standards-aware MIME library or sending platform generate filename parameters rather than manually improvising an encoding scheme.
Content-ID
Content-ID is most often used for inline assets such as images in an HTML email.
Content-ID: <brand-logo@example.com>
The HTML part can refer to that resource using a cid: URL:
<img src="cid:brand-logo@example.com" alt="Example logo">
This is the basis of embedded-image email. It can be appropriate for small, essential assets, but it has tradeoffs: messages become larger, some clients handle inline images inconsistently, and the asset does not benefit from normal web caching. For most campaign imagery, hosted HTTPS images are simpler. For a small logo in a receipt or critical offline-style document, a CID attachment may be justified.
How multipart MIME messages work
The most useful feature of MIME in email is multipart content. A multipart email contains separate body parts divided by a boundary string. The top-level Content-Type identifies the multipart subtype and supplies the boundary token.
A simplified multipart declaration looks like this:
Content-Type: multipart/alternative; boundary="alt-42"
Every section begins with two hyphens followed by the boundary:
--alt-42
The message ends with the same boundary followed by two additional hyphens:
--alt-42--
The boundary must be chosen so it does not accidentally appear in the content of a body part. Reputable MIME libraries generate sufficiently unique boundaries automatically. Do not hard-code short, obvious boundaries such as abc for production email.
multipart/alternative: text and HTML versions
multipart/alternative is the standard structure for a message that provides equivalent versions of the same content, usually plain text and HTML.
Content-Type: multipart/alternative; boundary="alt-42"
--alt-42
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Your order #1042 has shipped.
Track it at https://example.com/orders/1042
--alt-42
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html>
<body>
<p>Your order <strong>#1042</strong> has shipped.</p>
<p><a href="https://example.com/orders/1042">Track your order</a></p>
</body>
</html>
--alt-42--
The two parts should communicate the same essential message. The HTML version can include brand styling, buttons, tables, and imagery. The plain-text version should still include the core information, primary link, and any action the recipient must take.
A plain-text part is not a relic. It is a compatibility fallback for text-only clients, environments where HTML is disabled, accessibility workflows, security-conscious recipients, and troubleshooting tools. It also provides a resilient representation of the message if a client cannot render your HTML.
multipart/mixed: attachments plus a message body
multipart/mixed groups body content with attachments. A typical invoice email might have a multipart/mixed outer container, an inner multipart/alternative section for the email body, and a PDF attachment afterward.
The high-level hierarchy is:
multipart/mixed
├── multipart/alternative
│ ├── text/plain
│ └── text/html
└── application/pdf attachment
This nesting is important. The plain-text and HTML bodies are alternatives to each other, while the PDF is an additional file. Putting every part under one multipart/alternative container can cause an attachment to be treated as an alternative representation rather than as a separate file.
multipart/related: HTML and embedded assets
multipart/related indicates that parts are linked together, typically an HTML document and the inline images it references by CID.
A common hierarchy for an email with text, HTML, an embedded logo, and a downloadable PDF is:
multipart/mixed
├── multipart/alternative
│ ├── text/plain
│ └── multipart/related
│ ├── text/html
│ └── image/png inline asset
└── application/pdf attachment
This is why manually composing raw MIME can become error-prone quickly. The message may be logically simple to a recipient, but the correct structure involves nested containers, distinct headers, unique boundaries, and correct encodings for every part.
A complete MIME email example
The following shortened example shows the general shape of a text-and-HTML email. It omits real authentication headers and uses a fictional boundary for readability.
From: Billing <billing@example.com>
To: Taylor <taylor@example.net>
Subject: Your October receipt
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="volanea-alt-7f3c"
--volanea-alt-7f3c
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hi Taylor,
Your receipt for $49.00 is ready.
View it: https://example.com/receipts/1042
Thanks,
Example
--volanea-alt-7f3c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<!doctype html>
<html lang="en">
<body>
<p>Hi Taylor,</p>
<p>Your receipt for <strong>$49.00</strong> is ready.</p>
<p><a href="https://example.com/receipts/1042">View your receipt</a></p>
<p>Thanks,<br>Example</p>
</body>
</html>
--volanea-alt-7f3c--
The MIME-Version: 1.0 header indicates that the message uses MIME conventions. The top-level type is multipart/alternative, so the client sees two equivalent body choices. Each body part declares its own type, charset, and transfer encoding.
In a production message, the complete source would also contain normal routing and authentication-related headers added by the sending system and receiving mail servers. Do not confuse those headers with MIME itself. MIME makes the payload interpretable; authentication mechanisms such as SPF, DKIM, and DMARC establish separate signals about who is authorized to send and whether relevant signed content remained intact.
Why MIME in email matters for deliverability
MIME does not independently guarantee inbox placement. A correctly structured message can still be filtered because of poor sender reputation, unauthenticated sending, unwanted content, low engagement, or a bad recipient list. Conversely, a message with a strong sending reputation can still produce a poor recipient experience if the MIME is broken.
The practical relationship is that correct MIME removes avoidable technical failures and helps receiving systems and email clients process your message predictably.
Reliable rendering protects campaign performance
Campaign performance depends on recipients being able to understand and act on the message. If an HTML part is mislabeled as plain text, recipients may see raw tags instead of a usable promotion. If the text alternative is missing and HTML is disabled, the message may be effectively blank. If a crucial attachment is corrupt, the transactional email fails even if it technically reaches the inbox.
For a password-reset message, the text version should contain the reset link. For an order confirmation, it should contain the order number, amount, and support path. For a campaign, it should convey the offer and primary destination without relying solely on a hero image or styled button.
Those details influence real outcomes: clicks, support volume, conversion, and recipient trust. MIME is therefore a delivery-quality concern even though it is not an inbox-placement score.
Correct content types reduce ambiguity
Mail systems and clients need to classify content safely. Declaring an executable or unusual payload as a generic type, using the wrong type for an attachment, or sending incoherent headers creates ambiguity. Some receiving environments may treat unusual or malformed content defensively.
Use the actual media type whenever possible. A PDF should be application/pdf; a PNG should be image/png; a UTF-8 HTML email should be text/html; charset=UTF-8. Let your attachment library determine the type from trusted file handling logic when available, but validate edge cases, especially generated files and calendar invites.
MIME quality supports accessibility and resilience
A plain-text alternative is a key resilience feature. It helps recipients who use text-oriented readers, assistive technology, restricted networks, or clients that do not render a particular HTML feature. It is also useful when security tools strip or neutralize active-looking HTML constructs.
The plain-text part should not be an afterthought generated by deleting every tag without review. A good version has readable line breaks, clear labels, meaningful link destinations, and enough context to stand on its own. If the HTML says “Download now,” the text part should say what is being downloaded and why.
Message size has operational consequences
MIME structure and encodings add overhead. Base64 encoding expands binary attachments, inline images add weight directly to the message, and multipart boundaries plus duplicated text/HTML content add a smaller amount of overhead. Large messages can upload more slowly, encounter provider limits, or create a poor mobile experience.
The answer is not to remove MIME. The answer is to use the right MIME design. Host large campaign images externally, keep embedded assets limited, avoid attaching files when a secure download link is more appropriate, and ensure the message communicates useful information even if an image is not displayed.
MIME is not a rate or score
Unlike bounce rate, complaint rate, open rate, or click-through rate, MIME in email is not calculated as a percentage. There is no universal “MIME score” that tells you whether a message is good.
Instead, MIME is evaluated through correctness and interoperability. A message either has a structure clients can parse reliably, or it contains defects that may lead to inconsistent behavior. Quality assurance is therefore based on inspection and testing rather than a single formula.
Useful checks include:
- Does the source contain the expected
Content-Typefor every part? - Is each declared charset correct for the actual text bytes?
- Does every boundary open and close correctly?
- Does each attachment have a suitable media type and transfer encoding?
- Does the HTML message have a meaningful plain-text alternative?
- Do inline CIDs match the
cid:values referenced in HTML? - Does the message render correctly in representative inboxes and clients?
If you are measuring the operational impact of a MIME bug, use ordinary delivery and engagement data. For example, compare click activity or support tickets before and after correcting a malformed HTML part. But do not report that as a “MIME rate”; it is a downstream campaign or transactional performance measure.
Common MIME problems and their causes
MIME errors can originate in application code, template systems, file-processing pipelines, legacy mail libraries, or raw-message integrations. The most common problems are structural rather than mysterious.
Missing or weak plain-text content
A sender may provide only HTML because it looks correct in a browser preview. That can leave recipients without a useful fallback when HTML is disabled or rendered poorly.
Fix: Always provide both text/plain and text/html for normal human-facing email. Keep the message equivalent across both versions, including the core call to action and essential transactional data.
Incorrect Content-Type
A mislabeled part can render badly or download incorrectly. Typical examples include an HTML body sent as text/plain, a CSV sent as application/octet-stream when it should be clearly identified, or an image attachment assigned the wrong image subtype.
Fix: Use established MIME types and have your sending library set them. For generated content, test the exact output rather than assuming the file extension is enough.
Charset mismatches and garbled characters
Symptoms include replacement characters, question marks, corrupted names, or unreadable accented characters. The problem often occurs when the body is UTF-8 but the header claims another charset, or when a template is assembled from strings with inconsistent encodings.
Fix: Standardize text generation on UTF-8, declare charset=UTF-8 on text parts, and test emails containing real non-ASCII names and content. Do not test only with English ASCII placeholders.
Broken multipart boundaries
A malformed boundary can make an entire section disappear, merge an attachment into the body, or cause a client to display raw MIME source. Common mistakes include forgetting the final closing boundary, changing the boundary token in one location, or accidentally allowing the boundary string to occur in content.
Fix: Prefer a maintained MIME library or your provider’s structured sending API. If raw MIME is necessary, generate unique boundaries, preserve CRLF line endings, and validate the complete serialized message before sending.
Wrong transfer encoding
An attachment may arrive damaged when the content is not actually encoded the way the headers claim. Conversely, copying base64 content with altered line wrapping or omitted characters causes decoding errors.
Fix: Let a library perform transfer encoding. Do not manually concatenate binary strings into a message. For raw MIME workflows, encode content from the original bytes and avoid transformations after encoding.
Inline-image references that do not match
An HTML body may reference cid:header-logo, while the related image part declares a different Content-ID. The result is a broken image icon or empty space.
Fix: Generate the HTML cid: reference and Content-ID from the same source value. Include angle brackets in the MIME header value and omit them in the HTML cid: URL.
Inconsistent alternatives
A sender may put the real offer only in an image-heavy HTML version while the text version says only “View this email in your browser.” That is technically multipart but operationally weak.
Fix: Treat the text part as an actual version of the message. Include the offer, details, destination URL, unsubscribe information where applicable, and support context.
How to improve MIME quality in your sending stack
The safest improvement is architectural: avoid building MIME strings by hand unless you have a concrete requirement for raw-message control. Modern email libraries and sending APIs can accept structured fields for the sender, recipients, subject, text body, HTML body, headers, and attachments, then generate MIME correctly.
For teams that need direct control, review the email API reference and setup guides before implementing raw MIME handling. The correct approach depends on whether your application is constructing message source itself, attaching generated files, embedding assets, or relying on provider-side templates.
Start with a dependable default message shape
For most transactional and campaign sends, use this baseline:
- Send a UTF-8 plain-text body.
- Send a UTF-8 HTML body containing the same essential meaning.
- Use
multipart/alternativefor those two bodies. - Add
multipart/mixedonly when you have genuine attachments. - Add
multipart/relatedonly when you need embedded resources referenced from HTML. - Use hosted images unless an inline asset is necessary for the email’s function.
This design covers most product emails without unnecessary MIME complexity.
Use maintained libraries and preserve the serialized output
A mature library should handle quoting, header folding, transfer encoding, boundary generation, and nested multipart containers. This reduces the risk of defects that are difficult to see in an application-level preview.
Even when a library creates the message, inspect raw source during QA. A rendered preview alone may conceal an incorrect header or a malformed fallback part. Send test messages to multiple mailbox providers, view the original source, and compare what was generated with what your application intended.
Test realistic data and files
MIME bugs often hide behind unrealistic fixtures. Test with recipients whose names include accents or non-Latin characters. Test long subject lines, long URLs, empty optional fields, apostrophes, emoji where appropriate, and attachments with non-ASCII filenames.
For attachments, test small and larger examples within your platform’s documented limits. Open the delivered file from multiple major clients. For inline images, verify that the message still communicates its purpose if the image is blocked or the client does not display it.
Keep HTML email and MIME responsibilities distinct
HTML email compatibility is a separate concern from MIME correctness. A perfectly valid text/html part can still render differently across clients because email clients support different subsets of CSS and HTML. Likewise, a visually simple HTML email can be packaged incorrectly in MIME.
Separate your checks into two questions:
- Is the email markup compatible and understandable in target clients?
- Is the message packaged and labeled correctly so those clients receive the intended content?
That separation makes root-cause analysis much faster. If raw source shows the right parts and headers, investigate email HTML and client behavior. If the source is wrong, investigate the message-building layer first.
When raw MIME sending is the right choice
Structured sending APIs are best for common messages, but raw MIME has legitimate uses. Examples include forwarding or relaying an existing message, preserving a carefully constructed multipart hierarchy, generating advanced calendar messages, sending signed or encrypted content, or integrating a system that already emits complete RFC-style email source.
Raw MIME also gives you control over headers and every individual body part. That power comes with responsibility. Your application becomes responsible for line endings, header syntax, content encodings, multipart structure, and the relationship between HTML and inline files.
Use raw MIME when you need it, not merely because it appears more flexible. For standard receipts, account alerts, password resets, notifications, newsletters, and ordinary attachments, structured fields are easier to maintain and less likely to create a subtle interoperability issue.
If you do use raw MIME, establish automated tests that parse the outgoing message and assert its structure. Confirm that the top-level type is expected, parts are present in the correct hierarchy, boundaries close, attachments decode, and both plain-text and HTML bodies contain required content.
MIME, authentication, and deliverability: the practical relationship
It is tempting to treat all email technical controls as one category, but they perform different jobs. MIME defines content presentation and packaging. SPF evaluates whether sending infrastructure is authorized for an envelope sender domain. DKIM adds a cryptographic signature to selected headers and body content. DMARC applies a domain-owner policy and alignment framework around authentication results.
A sender needs all of these areas to work together. Strong authentication cannot repair an unreadable attachment. Perfect MIME does not make an unauthorized sender trustworthy. Clean recipient lists and relevant content do not eliminate the need for a usable plain-text fallback.
There is also an important interaction with message modification. MIME bodies are part of what a DKIM signer may sign. If a system modifies the content after signing—by changing encoding, altering a MIME boundary, or rewriting headers—the signature can fail depending on what was covered and how canonicalization was configured. The safe pattern is to finish MIME assembly before the final signing stage and avoid intermediate systems that rewrite content unnecessarily.
For deliverability operations, treat MIME as foundational hygiene. It should be correct before you analyze higher-level issues such as reputation, list quality, engagement, authentication alignment, or content strategy.
A practical MIME troubleshooting checklist
When an email is rendering incorrectly, an attachment will not open, or recipients report a broken version of a message, work through this sequence:
- Retrieve the delivered raw message source. Do not rely only on your application’s input payload or a visual preview.
- Check top-level headers. Confirm
MIME-Versionand the top-levelContent-Typematch the expected overall structure. - Map the multipart tree. Identify whether the message uses
alternative,mixed,related, or a nested combination. - Inspect every part. Confirm its
Content-Type, charset, transfer encoding, disposition, and content are consistent. - Check boundaries exactly. Every opening boundary should match the declared token, and the closing delimiter should be present.
- Decode attachments independently. Verify that the decoded bytes create a valid file and that the filename and media type are reasonable.
- Compare text and HTML meaning. Make sure the fallback includes essential content rather than placeholder text.
- Test in target clients. At minimum, review a webmail client and a desktop or mobile client used by your audience.
- Review the message-building code path. Look for string concatenation, unescaped dynamic values, encoding conversions, or post-processing after serialization.
This process prevents random changes. It helps distinguish a MIME assembly defect from a CSS rendering issue, a client-specific limitation, a blocked external image, or an unrelated deliverability problem.
The bottom line on MIME in email
MIME is the format layer that allows one email to contain rich, interoperable content. It tells receiving clients whether a section is plain text, HTML, an image, a PDF, or another media type; it provides safe encodings for transport; and it organizes multiple sections with multipart containers and boundaries.
For senders, the practical goal is straightforward: produce well-formed UTF-8 text and HTML alternatives, label every attachment accurately, keep multipart nesting purposeful, and let proven tooling generate the low-level syntax whenever possible. MIME will not replace authentication or a sound deliverability program, but correct MIME keeps technical formatting from becoming the reason a good email fails.
FAQ
What does MIME stand for in email?
MIME stands for Multipurpose Internet Mail Extensions. It is the standard that lets email messages carry HTML, plain text, attachments, inline images, and international characters instead of only basic ASCII text.
Is MIME in email a deliverability metric?
No. MIME is not a rate, score, or mailbox-provider metric. It is the technical structure of an email message. Poor MIME can hurt rendering and recipient experience, but it is not measured like bounce rate or complaint rate.
Why should an email include both plain text and HTML?
The HTML part provides visual formatting, while the plain-text part gives recipients a readable fallback when HTML is disabled, unsupported, blocked, or unsuitable for their email environment. Both versions should include the same essential information.
What is multipart/alternative in MIME?
multipart/alternative is a MIME container used for equivalent versions of one message, most commonly text/plain and text/html. Email clients generally choose the richest version they can render while retaining the plain-text option as a fallback.
Can a malformed MIME message cause an email to fail?
Yes. Broken boundaries, incorrect transfer encoding, invalid character-set declarations, or wrong content types can lead to unreadable content, corrupted attachments, missing sections, or inconsistent behavior across email clients. In some cases, severely malformed content may also trigger defensive handling by receiving systems.