Skip to content
Mbox Viewer

Multipart

boundary

A MIME message structure that combines multiple content parts — such as plain text, HTML, and attachments — in a single message, each separated by a unique boundary string.

A multipart MIME message has a Content-Type of multipart/mixed, multipart/alternative, multipart/related, or another multipart subtype. The header specifies a boundary parameter — a unique string like "----=_Part_12345" — that appears as a delimiter between each part in the message body. Each part has its own mini-header section declaring its Content-Type, encoding, and optional filename.

The most common multipart structure for a formatted email with attachments is nested: the outer container is multipart/mixed, which holds a multipart/alternative part (containing both plain-text and HTML versions of the body) alongside one or more attachment parts. Clients choose which alternative to display based on what they support, and they offer attachments for download.

Parsing nested multipart structures correctly is one of the more complex aspects of email processing. Malformed boundary strings, missing headers, or unusual nesting can trip up simpler parsers. A robust MIME implementation must handle edge cases gracefully so that messages with non-standard structure still render usefully rather than appearing as raw text.

Related terms

Read your MBOX files on your Mac