Export (0) Print
Expand All

2.2.3.3.2 Determining Which MIME Element Is the Message Body

The rules a MIME reader follows for selecting a message body are both qualifying, or positive, and disqualifying, or negative. To qualify as a message body, a MIME entity MUST meet at least one of the following conditions:

  • Content-Type header value is "text/plain", "text/HTML", "text/enriched", or "text/calendar".

  • Content-Type header value is "multipart/alternative" and at least one child MIME entity is "text/plain", "text/HTML", "text/enriched", or "text/calendar".

  • Content-Type header value is "multipart/related", and its first child MIME entity is either "text/HTML" or "multipart/alternative" with at least one "text/HTML" child MIME entity.

  • Content-Type header value is "multipart/mixed", and its first child MIME entity is "text/plain", "text/HTML", "text/enriched", or "text/calendar".

To qualify as a message body, a MIME entity MUST NOT have a Content-Disposition header (2) with the value "attachment".

In all cases, it is the text body part and not the containing multipart itself that is mapped to the message body.

MIME readers select the first MIME entity that qualifies according to the rules as the message body. MIME readers SHOULD then map the content of the selected MIME entity to a Message object property value according to the following rules:

  1. If the body MIME entity is a single "text/plain", copy its content to the value of the PidTagBody property ([MS-OXCMSG] section 2.2.1.56.1).

  2. If the body MIME entity is a single "text/HTML", copy its content to the value of the PidTagHtml property ([MS-OXCMSG] section 2.2.1.56.9).

  3. If the body MIME entity is a single "text/enriched", convert its content to HTML and copy the result to the value of the PidTagHtml property. The format of the "text/enriched" MIME type is specified in [MSFT-RTF], [MS-OXRTFEX], and [MS-OXRTFCP].

  4. If the body MIME entity is a single "text/calendar", parse the iCalendar document and copy the value of the DESCRIPTION property to the PidTagBody property. If the DESCRIPTION property is missing, MIME readers can use the value of the COMMENT property instead. For details, see [MS-OXCICAL].

  5. If the body MIME entity is "multipart/alternative", MIME readers SHOULD select the last child entity that has one of the four eligible types ("text/plain", "text/HTML", "text/enriched", or "text/calendar") and map it. However, if the last child entity is "text/calendar" and one of the preceding entities is "text/HTML", MIME readers SHOULD map the "text/HTML" value, instead of the DESCRIPTION property of the "text/calendar" value, to the PidTagRtfCompressed property ([MS-OXCMSG] section 2.2.1.56.4).

  6. If the body MIME entity is "multipart/related", identify the first child MIME entity that is either "text/HTML" or "multipart/alternative" and map it according to rules 1-5.

  7. If the body MIME entity is "multipart/mixed", MIME readers SHOULD identify the first MIME entity that has one of the four eligible types ("text/plain", text/HTML", "text/enriched", or "text/calendar") and map it. Alternatively, MIME readers MAY<143> create an aggregate body as specified in section 2.2.3.3.2.2.

Show:
© 2014 Microsoft