HOME

TheInfoList



OR:

Multipurpose Internet Mail Extensions (MIME) is an
Internet standard In computer network engineering, an Internet Standard is a normative specification of a technology or methodology applicable to the Internet. Internet Standards are created and published by the Internet Engineering Task Force (IETF). They allow ...
that extends the format of
email Electronic mail (email or e-mail) is a method of exchanging messages ("mail") between people using electronic devices. Email was thus conceived as the electronic ( digital) version of, or counterpart to, mail, at a time when "mail" mean ...
messages to support text in
character set Character encoding is the process of assigning numbers to graphical characters, especially the written characters of human language, allowing them to be stored, transmitted, and transformed using digital computers. The numerical values tha ...
s other than
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
, as well as attachments of audio, video, images, and application programs. Message bodies may consist of multiple parts, and header information may be specified in non-ASCII character sets. Email messages with MIME formatting are typically transmitted with standard protocols, such as the Simple Mail Transfer Protocol (SMTP), the
Post Office Protocol In computing, the Post Office Protocol (POP) is an application-layer Internet standard protocol used by e-mail clients to retrieve e-mail from a mail server. POP version 3 (POP3) is the version in common use, and along with IMAP the most common ...
(POP), and the Internet Message Access Protocol (IMAP). The MIME standard is specified in a series of requests for comments: , , , , and . The integration with SMTP email is specified in and . Although the MIME formalism was designed mainly for SMTP, its content types are also important in other
communication protocols A communication protocol is a system of rules that allows two or more entities of a communications system to transmit information via any kind of variation of a physical quantity. The protocol defines the rules, syntax, semantics and synchron ...
. In the
HyperText Transfer Protocol The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide We ...
(HTTP) for the
World Wide Web The World Wide Web (WWW), commonly known as the Web, is an information system enabling documents and other web resources to be accessed over the Internet. Documents and downloadable media are made available to the network through web ...
, servers insert a MIME header field at the beginning of any Web transmission. Clients use the content type or
media type A media type (also known as a MIME type) is a two-part identifier for file formats and format contents transmitted on the Internet. The Internet Assigned Numbers Authority (IANA) is the official authority for the standardization and publication o ...
header to select an appropriate viewer application for the type of data indicated.


History

MIME originated from the Andrew Messaging System, which was part of Andrew Project developed at
Carnegie Mellon University Carnegie Mellon University (CMU) is a private research university in Pittsburgh, Pennsylvania. One of its predecessors was established in 1900 by Andrew Carnegie as the Carnegie Technical Schools; it became the Carnegie Institute of Technology ...
(CMU), as a cross-platform alternative to the Andrew-specific data format.


MIME header fields


MIME-Version

The presence of this header field indicates the message is MIME-formatted. The value is typically "1.0". The field appears as follows: MIME-Version: 1.0 According to MIME co-creator
Nathaniel Borenstein Nathaniel S. Borenstein (born September 23, 1957) is an American computer scientist. He is one of the original designers of the MIME protocol for formatting multimedia Internet electronic mail and sent the first e-mail attachment. Biography Bore ...
, the version number was introduced to permit changes to the MIME protocol in subsequent versions. However, Borenstein admitted short-comings in the specification that hindered the implementation of this feature: ''"We did not adequately specify how to handle a future MIME version. ... So if you write something that knows 1.0, what should you do if you encounter 2.0 or 1.1? I sort of thought it was obvious but it turned out everyone implemented that in different ways. And the result is that it would be just about impossible for the Internet to ever define a 2.0 or a 1.1."''


Content-Type

This header field indicates the
media type A media type (also known as a MIME type) is a two-part identifier for file formats and format contents transmitted on the Internet. The Internet Assigned Numbers Authority (IANA) is the official authority for the standardization and publication o ...
of the message content, consisting of a ''type'' and ''subtype'', for example Content-Type: text/plain Through the use of the ''multipart'' type, MIME allows mail messages to have parts arranged in a
tree structure A tree structure, tree diagram, or tree model is a way of representing the hierarchical nature of a structure in a graphical form. It is named a "tree structure" because the classic representation resembles a tree, although the chart is genera ...
where the leaf nodes are any non-multipart content type and the non-leaf nodes are any of a variety of multipart types. This mechanism supports: * simple text messages using ''text/plain'' (the default value for "Content-Type: ") * text plus attachments (''multipart/mixed'' with a ''text/plain'' part and other non-text parts). A MIME message including an attached file generally indicates the file's original name with the field "Content-Disposition", so that the type of file is indicated both by the MIME content-type and the (usually OS-specific)
filename extension A filename extension, file name extension or file extension is a suffix to the name of a computer file (e.g., .txt, .docx, .md). The extension indicates a characteristic of the file contents or its intended use. A filename extension is typically ...
* reply with original attached (''multipart/mixed'' with a ''text/plain'' part and the original message as a ''message/rfc822'' part) * alternative content, such as a message sent in both plain text and another format such as
HTML The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaS ...
(''multipart/alternative'' with the same content in ''text/plain'' and ''text/html'' forms) * image, audio, video and application (for example, ''image/jpeg'', ''audio/mp3'', ''video/mp4'', and ''application/msword'' and so on) * many other message constructs


Content-Disposition

The original MIME specifications only described the structure of mail messages. They did not address the issue of presentation styles. The content-disposition header field was added in RFC 2183 to specify the presentation style. A MIME part can have: * an ''inline'' content disposition, which means that it should be automatically displayed when the message is displayed, or * an ''attachment'' content disposition, in which case it is not displayed automatically and requires some form of action from the user to open it. In addition to the presentation style, the field ''Content-Disposition'' also provides parameters for specifying the name of the file, the creation date and modification date, which can be used by the reader's mail user agent to store the attachment. The following example is taken from RFC 2183, where the header field is defined: Content-Disposition: attachment; filename=genome.jpeg; modification-date="Wed, 12 Feb 1997 16:29:51 -0500"; The filename may be encoded as defined in RFC 2231. As of 2010, a majority of mail user agents did not follow this prescription fully. The widely used Mozilla Thunderbird mail client ignores the ''content-disposition'' fields in the messages and uses independent algorithms for selecting the MIME parts to display automatically. Thunderbird prior to version 3 also sends out newly composed messages with ''inline'' content disposition for all MIME parts. Most users are unaware of how to set the content disposition to ''attachment''. Many mail user agents also send messages with the file name in the ''name'' parameter of the ''content-type'' header instead of the ''filename'' parameter of the header field ''Content-Disposition''. This practice is discouraged, as the file name should be specified either with the parameter ''filename'', or with both the parameters ''filename'' and ''name''. In HTTP, the response header field ''Content-Disposition: attachment'' is usually used as a hint to the client to present the response body as a downloadable file. Typically, when receiving such a response, a
Web browser A web browser is application software for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's screen. Browsers are used o ...
prompts the user to save its content as a file, instead of displaying it as a page in a browser window, with ''filename'' suggesting the default file name.


Content-Transfer-Encoding

In June 1992, MIME (RFC 1341, since made obsolete by RFC 2045) defined a set of methods for representing binary data in formats other than ASCII text format. The ''content-transfer-encoding:'' MIME header field has 2-sided significance: * It indicates whether or not a
binary-to-text encoding A binary-to-text encoding is encoding of data in plain text. More precisely, it is an encoding of binary data in a sequence of printable characters. These encodings are necessary for transmission of data when the channel does not allow binary ...
scheme has been used on top of the original encoding as specified within the Content-Type header: # If such a binary-to-text encoding method has been used, it states which one. # If not, it provides a descriptive label for the format of content, with respect to the presence of 8-bit or binary content. The RFC and th
IANA's list
of transfer encodings define the values shown below, which are not case sensitive. Note that '7bit', '8bit', and 'binary' mean that no binary-to-text encoding on top of the original encoding was used. In these cases, the header field is actually redundant for the email client to decode the message body, but it may still be useful as an indicator of what type of object is being sent. Values '
quoted-printable Quoted-Printable, or QP encoding, is a binary-to-text encoding system using printable ASCII characters (alphanumeric and the equals sign =) to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. Hist ...
' and ' base64' tell the email client that a binary-to-text encoding scheme was used and that appropriate initial decoding is necessary before the message can be read with its original encoding (e.g. UTF-8). * Suitable for use with normal SMTP: ** 7bit – up to 998
octets Octet may refer to: Music * Octet (music), ensemble consisting of eight instruments or voices, or composition written for such an ensemble ** String octet, a piece of music written for eight string instruments *** Octet (Mendelssohn), 1825 compo ...
per line of the code range 1..127 with CR and LF (codes 13 and 10 respectively) only allowed to appear as part of a CRLF line ending. This is the default value. **
quoted-printable Quoted-Printable, or QP encoding, is a binary-to-text encoding system using printable ASCII characters (alphanumeric and the equals sign =) to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. Hist ...
– used to encode arbitrary octet sequences into a form that satisfies the rules of 7bit. Designed to be efficient and mostly human readable when used for text data consisting primarily of US-ASCII characters but also containing a small proportion of bytes with values outside that range. ** base64 – used to encode arbitrary octet sequences into a form that satisfies the rules of 7bit. Designed to be efficient for non-text 8 bit and binary data. Sometimes used for text data that frequently uses non-US-ASCII characters. * Suitable for use with SMTP servers that support the
8BITMIME The Simple Mail Transfer Protocol (SMTP) is an Internet standard communication protocol for electronic mail transmission. Mail servers and other message transfer agents use SMTP to send and receive mail messages. User-level email clients typi ...
SMTP extension (RFC 6152): **8bit – up to 998 octets per line with CR and LF (codes 13 and 10 respectively) only allowed to appear as part of a CRLF line ending. * Suitable for use with SMTP servers that support the BINARYMIME SMTP extension (RFC 3030): ** binary – any sequence of octets. There is no encoding defined which is explicitly designed for sending arbitrary binary data through SMTP transports with the 8BITMIME extension. Thus, if BINARYMIME isn't supported, base64 or quoted-printable (with their associated inefficiency) are sometimes still useful. This restriction does not apply to other uses of MIME such as Web Services with MIME attachments or MTOM.


Encoded-Word

Since RFC 2822, conforming message header field names and values use ASCII characters; values that contain non-ASCII data should use the MIME encoded-word syntax (RFC 2047) instead of a literal string. This syntax uses a string of ASCII characters indicating both the original character encoding (the "''charset''") and the content-transfer-encoding used to map the bytes of the charset into ASCII characters. The form is: "=?''charset''?''encoding''?''encoded text''?=". * ''charset'' may be any character set registered with
IANA The Internet Assigned Numbers Authority (IANA) is a standards organization that oversees global IP address allocation, autonomous system number allocation, root zone management in the Domain Name System (DNS), media types, and other Interne ...
. Typically it would be the same charset as the message body. * ''encoding'' can be either "Q" denoting Q-encoding that is similar to the
quoted-printable Quoted-Printable, or QP encoding, is a binary-to-text encoding system using printable ASCII characters (alphanumeric and the equals sign =) to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. Hist ...
encoding, or "B" denoting base64 encoding. * ''encoded text'' is the Q-encoded or base64-encoded text. * An ''encoded-word'' may not be more than 75 characters long, including ''charset'', ''encoding'', ''encoded text'', and delimiters. If it is desirable to encode more text than will fit in an ''encoded-word'' of 75 characters, multiple ''encoded-word''s (separated by CRLF SPACE) may be used.


Difference between Q-encoding and quoted-printable

The ASCII codes for the question mark ("?") and equals sign ("=") may not be represented directly as they are used to delimit the encoded word. The ASCII code for space may not be represented directly because it could cause older parsers to split up the encoded word undesirably. To make the encoding smaller and easier to read the underscore is used to represent the ASCII code for space creating the side effect that underscore cannot be represented directly. The use of encoded words in certain parts of header fields imposes further restrictions on which characters may be represented directly. For example, Subject: =?iso-8859-1?Q?=A1Hola,_se=F1or!?= is interpreted as "Subject: ¡Hola, señor!". The encoded-word format is not used for the names of the headers fields (for example ''Subject''). These names are usually English terms and always in ASCII in the raw message. When viewing a message with a non-English email client, the header field names might be translated by the client.


Multipart messages

The MIME multipart message contains a boundary in the header field ; this boundary, which must not occur in any of the parts, is placed between the parts, and at the beginning and end of the body of the message, as follows: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=frontier This is a message with multiple parts in MIME format. --frontier Content-Type: text/plain This is the body of the message. --frontier Content-Type: application/octet-stream Content-Transfer-Encoding: base64 PGh0bWw+CiAgPGhlYWQ+CiAgPC9oZWFkPgogIDxib2R5PgogICAgPHA+VGhpcyBpcyB0aGUg Ym9keSBvZiB0aGUgbWVzc2FnZS48L3A+CiAgPC9ib2R5Pgo8L2h0bWw+Cg

--frontier--
Each part consists of its own content header (zero or more header fields) and a body. Multipart content can be nested. The of a multipart type must always be "7bit", "8bit" or "binary" to avoid the complications that would be posed by multiple levels of decoding. The multipart block as a whole does not have a charset; non-ASCII characters in the part headers are handled by the Encoded-Word system, and the part bodies can have charsets specified if appropriate for their content-type. Notes: * Before the first boundary is an area that is ignored by MIME-compliant clients. This area is generally used to put a message to users of old non-MIME clients. * It is up to the sending mail client to choose a boundary string that doesn't clash with the body text. Typically this is done by inserting a long random string. * The last boundary must have two hyphens at the end.


Multipart subtypes

The MIME standard defines various multipart-message subtypes, which specify the nature of the message parts and their relationship to one another. The subtype is specified in the header field of the overall message. For example, a multipart MIME message using the digest subtype would have its set as "multipart/digest". The RFC initially defined four subtypes: mixed, digest, alternative and parallel. A minimally compliant application must support mixed and digest; other subtypes are optional. Applications must treat unrecognized subtypes as "multipart/mixed". Additional subtypes, such as signed and form-data, have since been separately defined in other RFCs.


mixed

multipart/mixed is used for sending files with different header fields inline (or as attachments). If sending pictures or other easily readable files, most mail clients will display them inline (unless explicitly specified with ''Content-Disposition: attachment'' in which case offered as attachments). The default content-type for each part is "text/plain". The type is defined in RFC 2046.


digest

multipart/digest is a simple way to send multiple text messages. The default content-type for each part is "message/rfc822". The MIME type is defined in RFC 2046.


alternative

The multipart/alternative subtype indicates that each part is an "alternative" version of the same (or similar) content, each in a different format denoted by its "Content-Type" header. The order of the parts is significant. RFC1341 states: ''In general, user agents that compose multipart/alternative entities should place the body parts in increasing order of preference, that is, with the preferred format last.'' Systems can then choose the "best" representation they are capable of processing; in general, this will be the last part that the system can understand, although other factors may affect this. Since a client is unlikely to want to send a version that is less faithful than the plain text version, this structure places the plain text version (if present) first. This makes life easier for users of clients that do not understand multipart messages. Most commonly, multipart/alternative is used for email with two parts, one plain text (text/plain) and one HTML (text/html). The plain text part provides backwards compatibility while the HTML part allows use of formatting and hyperlinks. Most email clients offer a user option to prefer plain text over HTML; this is an example of how local factors may affect how an application chooses which "best" part of the message to display. While it is intended that each part of the message represent the same content, the standard does not require this to be enforced in any way. At one time, anti-spam filters would only examine the text/plain part of a message, because it is easier to parse than the text/html part. But spammers eventually took advantage of this, creating messages with an innocuous-looking text/plain part and advertising in the text/html part. Anti-spam software eventually caught up on this trick, penalizing messages with very different text in a multipart/alternative message. The type is defined in RFC 2046.


related

A multipart/related is used to indicate that each message part is a component of an aggregate whole. It is for compound objects consisting of several inter-related components proper display cannot be achieved by individually displaying the constituent parts. The message consists of a root part (by default, the first) which reference other parts inline, which may in turn reference other parts. Message parts are commonly referenced by ''Content-ID''. The syntax of a reference is unspecified and is instead dictated by the encoding or protocol used in the part. One common usage of this subtype is to send a web page complete with images in a single message. The root part would contain the
HTML The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaS ...
document, and use image tags to reference images stored in the latter parts. The type is defined in RFC 2387.


report

''multipart/report'' is a message type that contains data formatted for a mail server to read. It is split between a text/plain (or some other content/type easily readable) and a message/delivery-status, which contains the data formatted for the mail server to read. The type is defined in RFC 6522.


signed

A multipart/signed message is used to attach a
digital signature A digital signature is a mathematical scheme for verifying the authenticity of digital messages or documents. A valid digital signature, where the prerequisites are satisfied, gives a recipient very high confidence that the message was created b ...
to a message. It has exactly two body parts, a body part and a signature part. The whole of the body part, including mime fields, is used to create the signature part. Many signature types are possible, like "application/pgp-signature" (RFC 3156) and "application/pkcs7-signature" ( S/MIME). The type is defined in RFC 1847.


encrypted

A multipart/encrypted message has two parts. The first part has control information that is needed to decrypt the application/octet-stream second part. Similar to signed messages, there are different implementations which are identified by their separate content types for the control part. The most common types are "application/pgp-encrypted" (RFC 3156) and "application/pkcs7-mime" ( S/MIME). The MIME type defined in RFC 1847.


form-data

The MIME type ''multipart/form-data'' is used to express values submitted through a form. Originally defined as part of
HTML The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaS ...
4.0, it is most commonly used for submitting files with
HTTP The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide We ...
. It is specified in RFC 7578, superseding RFC 2388
example


x-mixed-replace

The content type multipart/x-mixed-replace was developed as part of a technology to emulate server push and streaming over HTTP. All parts of a mixed-replace message have the same semantic meaning. However, each part invalidates "replaces" the previous parts as soon as it is received completely. Clients should process the individual parts as soon as they arrive and should not wait for the whole message to finish. Originally developed by
Netscape Netscape Communications Corporation (originally Mosaic Communications Corporation) was an American independent computer services company with headquarters in Mountain View, California and then Dulles, Virginia. Its Netscape web browser was on ...
, it is still supported by
Mozilla Mozilla (stylized as moz://a) is a free software community founded in 1998 by members of Netscape. The Mozilla community uses, develops, spreads and supports Mozilla products, thereby promoting exclusively free software and open standards, ...
,
Firefox Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements current ...
,
Safari A safari (; ) is an overland journey to observe wild animals, especially in eastern or southern Africa. The so-called "Big Five" game animals of Africa – lion, leopard, rhinoceros, elephant, and Cape buffalo – particularly form an impor ...
, and
Opera Opera is a form of theatre in which music is a fundamental component and dramatic roles are taken by singers. Such a "work" (the literal translation of the Italian word "opera") is typically a collaboration between a composer and a libr ...
. It is commonly used in
IP camera An Internet Protocol camera, or IP camera, is a type of digital video camera that receives control data and sends image data via an IP network. They are commonly used for surveillance, but, unlike analog closed-circuit television (CCTV) camera ...
s as the MIME type for MJPEG streams. It was supported by Chrome for main resources until 2013 (images can still be displayed using this content type).


byterange

The multipart/byterange is used to represent noncontiguous byte ranges of a single message, it is used by HTTP when a server returns multiple byte ranges and is defined in RFC 2616.


RFC documentation

* , ''SMTP Service Extension for 8bit-MIMEtransport''. J. Klensin, N. Freed, M. Rose, E. Stefferud, D. Crocker. February 1993. * , ''Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted'' * , ''MIME Security with OpenPGP'' * , ''MIME Part One: Format of Internet Message Bodies'' * , ''MIME Part Two: Media Types''. N. Freed,
Nathaniel Borenstein Nathaniel S. Borenstein (born September 23, 1957) is an American computer scientist. He is one of the original designers of the MIME protocol for formatting multimedia Internet electronic mail and sent the first e-mail attachment. Biography Bore ...
. November 1996. * , ''MIME Part Three: Message Header Extensions for Non-ASCII Text''.
Keith Moore Keith may refer to: People and fictional characters * Keith (given name), includes a list of people and fictional characters * Keith (surname) * Keith (singer), American singer James Keefer (born 1949) * Baron Keith, a line of Scottish barons ...
. November 1996. * , ''MIME Part Four: Media Type Specifications and Registration Procedures''. * , ''MIME Part Four: Registration Procedures''. N. Freed, J. Klensin. December 2005. * , ''MIME Part Five: Conformance Criteria and Examples''. N. Freed, N. Borenstein. November 1996. * , ''Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field''. Troost, R., Dorner, S. and K. Moore. August 1997. * , ''MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations''. N. Freed, K. Moore. November 1997. * , ''The MIME Multipart/Related Content-type'' * , ''Mechanisms for Specifying and Describing the Format of Internet Message Bodies''


See also

*
8BITMIME The Simple Mail Transfer Protocol (SMTP) is an Internet standard communication protocol for electronic mail transmission. Mail servers and other message transfer agents use SMTP to send and receive mail messages. User-level email clients typi ...
*
Binary-to-text encoding A binary-to-text encoding is encoding of data in plain text. More precisely, it is an encoding of binary data in a sequence of printable characters. These encodings are necessary for transmission of data when the channel does not allow binary ...
* Direct Internet Message Encapsulation (DIME) a now superseded
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washi ...
-proposed
protocol Protocol may refer to: Sociology and politics * Protocol (politics), a formal agreement between nation states * Protocol (diplomacy), the etiquette of diplomacy and affairs of state * Etiquette, a code of personal behavior Science and technology ...
intended as a streamlined MIME, primarily for use in web services. * Mailcap * mime.types * Object Linking and Embedding (OLE) * S/MIME * Simple Mail Transfer Protocol (SMTP) * SOAP with Attachments *
Unicode and email Many email clients now offer some support for Unicode. Some clients will automatically choose between a legacy encoding and Unicode depending on the mail's content, either automatically or when the user requests it. Technical requirements for send ...
* Uuencoding * VPIM


References


Further reading

* * * * *


External links


MIME Media Types
comprising a list of directories of content types and subtypes, maintained by
Internet Assigned Numbers Authority The Internet Assigned Numbers Authority (IANA) is a standards organization that oversees global IP address allocation, autonomous system number allocation, root zone management in the Domain Name System (DNS), media types, and other Inte ...
.
List of Character Sets

Properly Configuring Server MIME Types


* * ttp://mime.ritey.com/ Free Online PHP MIME checker
Free Online MIME Email Validator
{{DEFAULTSORT:Mime