MIME Headers
Each MIME header in a part contains information about the part. The most important aspect of using the MIME format is understanding the MIME headers. This section presents a quick overview of the headers supported by the MIME package. Using the MIME Headers Effectively presents a more detailed look at the MIME headers.
*MIME-Version
The MIME-Version header specifies the version of MIME used to construct the MIME part. This header is required for MIME messages, optional for other MIME parts. The MIME specification defines the value of this header to be 1.0.
Example: MIME-Version: 1.0
*Content-Type
The Content-Type header describes the type of content the message contains.
Example: Content-Type: image/jpeg
The value of the header has two parts, separated by a forward slash. The first part of the value is the media type, a general description of the content. The second part of the value is the subtype, the specific type of the content.
The MIME specification defines a multipart content type for a part body that contains other MIME parts. All multipart content types require a boundary parameter. The boundary is used to delimit the other MIME parts contained within the part body. Because the boundary is used as a delimiter, the boundary should not appear in any of the contained parts.
Example: Content-Type: multipart/mixed; boundary="_bounds_"
If a part does not have a Content-Type header, the content type of the part is text/plain; charset=us-ascii.
*Content-Transfer-Encoding
The Content-Transfer-Encoding header describes whether the body has been processed for transmission. The header also describes the current representation of the body.
Example: Content-Transfer-Encoding: base64
If a part does not have a Content-Transfer-Encoding header, the content transfer encoding of the part is 7bit.
*Content-Description
The Content-Description header provides a human-readable description of the content.
Example: Content-Description: Crater Lake photo
*Content-ID
The Content-ID header labels a part with a unique identifier. Other parts can refer to the part by using the identifier, even if the other parts are in a different message.
Example: Content-ID: <part91034@roguewave.example>
*Content-Location
The Content-Location header labels a part with a URI. Other parts in the same message can refer to the part body by using the URI.
Example: Content-Location: http://roguewave.example/lake.jpg
*Content-Disposition
The Content-Disposition header indicates how an application should process a part.
Example: Content-Disposition: inline