MIME Message Body Parts

A message body formatted according to the Multipurpose Internet Mail Extensions (MIME) specification is subdivided into parts that are organized as a hierarchy. As with any hierarchy, some parts contain other parts called descendants, and all parts have ancestors except for the top part, called the root. Each part or subdivision of the body is defined as a body part. Body parts that do not contain other body parts are defined as content body parts, and body parts that do contain other body parts are defined as multipart body parts. The following example shows a hierarchy of parts; located at the top of the hierarchy is the root body part, labeled R. It has direct descendants, labeled A1 and A2.

R
  A1
    A1.1
    A1.2
  A2
    A2.1
    A2.2

The body parts R, A1, and A2 are multipart body parts because they contain descendants; A1.1, A1.2, A2.1, and A2.2 are content body parts because they do not contain descendants. These body parts contain the actual content of the message, such as the plain text version of the message, an attachment, a HTML page, and so on.

In the MIME formatting scheme, multipart body parts contain only other body parts and do not directly contain the content of the message. Their purpose is to define the relationship of their descendants.

The MIME specification defines the header Content-Type to indicate the type of body part. For example, the body part type indicates what kind of data the body part contains. Values for the Content-Type header contain a primary and secondary type indicator separated by a forward slash (/), for example, image/gif and multipart/related. Multipart body parts always have a primary type of multipart. All non-multipart body parts have some other type of multipart, for example image, application, text, and so on. For additional information, see MIME Extensions to Internet Mail in the appendix.