MIME_Multipurpose_Internet_Mail_Extensions
MIME_Multipurpose_Internet_Mail_Extensions
Introduction to MIME
MIME (Multipurpose Internet Mail Extensions) is a standard which was proposed by Bell
Communications in 1991 in order to expand upon the limited capabilities of email, and
in particular to allow documents (such as images, sound, and text) to be inserted in a
message. It was originally defined by RFCs 1341 and 1342 in June 1992.
Using headers, MIME describes the type of message content and the encoding used.
MIME-Version: This is the version of the MIME standard used in the message.
Currently only version 1.0 exists.
Content-type: Describes the data's type and subtype. It can include a "charset"
parameter, separated by a semi-colon, defining which character set to use.
Content-Transfer-Encoding: Defines the encoding used in the message body
Content-ID: Represents a unique identification for each message segment
Content-Description: Gives additional information about the message content.
Content-Disposition: Defines the attachment's settings, in particular the name
associated with the file, using the attribute filename.
MIME types, used in the Content-Type header, are used to classify documents attached
to an email. A MIME type is comprised as follows:
Content-type: main_mime_type/mime_subtype
A GIF image, for example, has the following MIME type:
Content-type: image/gif
The primary data types, sometimes called "discrete data types," are:
Encoding formats
To transfer binary data, MIME offers five encoding formats which can be used in the
header transfer-encoding:
7bit: 7-bit text format (for messages without accented characters);
8bit: 8-bit text format;
quoted-printable: Quoted-Printable format, recommended for messages which use a
7-bit alphabet (such as when there are accent marks);
base64: Base 64, recommended for sending binary files as attachments;
binary: binary format; not recommended.
Since MIME is very open, it can use third-party encoding formats such as:
Header encoding
The transfer-encoding header is used to specify an encoding format for the message
body, but it doesn't solve the problem of encoding headers themselves (such as the
message subject).
To encode headers with character sets which use more than 7 bits, such as for
including accented letters in an email's subject, the MIME standard offers the following
format:
=?charset?encoding?result?=
charset represents the character set used,
encoding defines the encoding desired with two possible values:
Q for quoted-printable
B for base64
result: text encoded using the method specified.
Below is an example of Quoted-Printable encoding with "Building façade" as the
email's subject.
Subject: Building fa=?ISO-8859-1?Q?=E7ade?=
Composite messages
With the MIME type "multipart", the MIME standard allows for composite messages,
meaning messages which include multiple attachments, which may even be nested.
To do so, MIME allows for a standard called boundary. This is an arbitrary string
defined as an attribute in the Content-type header:
Content-Type: multipart/mixed;
boundary="------------020005090303070203010601"
Each separator delimits a portion of content beginning with the headers Content-
Type and Content-Encoding. It is essential that the value of this separator is not found
within the message contents.
There are several types of separators:
MIME types are standardized by a group called the IANA (Internet Assigned Numbers
Authority). Here is a non-exhaustive list of the most common MIME types.
Associated
MIME Type Type of file
extension
video/dv DV videos dv
Source: http://en.kioskea.net/contents/120-mime-multipurpose-internet-mail-
extensions