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 adds the following features to email service:
MIME uses special header directives to describe the format used in a message body, so that the email client can interpret it correctly:
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_subtypeA GIF image, for example, has the following MIME type:
The primary data types, sometimes called "discrete data types," are:
MIME types are also used on the Web to classify documents transferred using the protocol HTTP. Thus during a transaction between a web server and a browser, the first thing the web server does is send the MIME type of the file to the browser, so that the browser knows how to display the document.
To transfer binary data, MIME offers five encoding formats which can be used in the header transfer-encoding:
Since MIME is very open, it can use third-party encoding formats such as:
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:
Subject: Building fa=?ISO-8859-1?Q?=E7ade?=
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;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.
|MIME Type||Type of file||Associated extension|
|application/atom+xml||Files in ATOM format||atom|
|application/iges||IGES CAD exchange format||igs,iges|
|application/octet-stream||Non-interpreted binary files||bin|
|application/msword||Microsoft Word document files||doc|
|application/pdf||Adobe Acrobat files|
|application/rtf||Rich text format||rtf|
|application/vnd.ms-excel||Microsoft Excel spreadsheet files||xls|
|application/vnd.ms-powerpoint||Microsoft Powerpoint presentation files||ppt|
|application/x-tar||Compressed tar files||tar|
|application/zip||Compressed ZIP files||man|
|audio/basic||Basic audio files||au,snd|
|audio/mpeg||MPEG audio files||mpg,mp3|
|audio/mp4||MPEG-4 audio files||mp4|
|audio/x-aiff||AIFF audio files||aif,aiff,aifc|
|audio/x-wav||Wave audio files||wav|
|image/x-portable-bitmap||PBM Bitmap files||pbm|
|image/x-portable-graymap||PBM Graymap files||pgm|
|image/x-portable-pixmap||PBM Pixmap files||ppm|
|multipart/x-zip||Zip archive files||zip|
|multipart/x-gzip||GNU zip archive files||gz,gzip|
|text/csv||Comma-separated text files||csv|
|text/plain||Unformatted text files||txt,g,h,c,cc,hh,m,f90|
|text/richtext||Rich text files||rtx|
|text/rtf||Rich Text Format text files||rtf|
|text/tab-separated-value||Tab-separated text files||tsv|
|video/msvideo||Microsoft Windows videos||avi|