The MIME Message Format
Topic Last Modified: 2004-06-08
The Multipurpose Internet Mail Extensions (MIME) message format standard specifies how to format messages so that client programs can decode and display complex message bodies that can contain rich text, multiple character sets, and binary attachments such as pictures, sounds, spreadsheets, and so on. MIME is a richer and more flexible technology than Uuencode and provides generic and flexible mechanisms for including content within messages. With MIME formatting, you can:
Specify alternate content encoding mechanisms for each body part.
Relate groups of multiple content parts within a message.
Use character sets other than US-ASCII character sets in body parts and message header fields.
Specify the intended disposition of a content part (for example, inline or attachment).
Most importantly, MIME is defined to allow for future application-specific enhancements and additions without changing the underlying format structure.
A message body that is formatted in MIME normally contains multiple nodes or parts, which are arranged in a hierarchy. As in any such hierarchy, there are container nodes and leaf nodes. A container node contains other nodes, and leaf nodes do not. In the following discussions, each node in a message body hierarchy is called a body part. The entire hierarchy makes up the sum total of the body of the message according to RFC 822. Container nodes in the hierarchy are called multipartbody parts, and leaf nodes are called content body parts. Multipart body parts exist solely to create the hierarchy, and as such, they encapsulate other multipart or content body parts. Multipart body parts do not have content other than other body parts.
The MIME specification defines the core header field Content-Type to indicate the type of the body part. The Content-Type field is made up of a primary and secondary type. Multipart body parts have a primary type of multipart. All others have a defined type other than multipart.