MIME
Adapted from Wikipedia · Discoverer experience
Multipurpose Internet Mail Extensions, known as MIME, is a standard that helps make email messages more versatile. It allows emails to include more than just plain text. With MIME, emails can have text written in different languages, not just the basic ASCII system. It also lets people send pictures, videos, sound files, and even programs as attachments along with their messages.
MIME is an official Internet standard and is described in several important documents called request for comments or RFCs. These documents explain the rules and details of how MIME works. MIME works well with common email systems such as the Simple Mail Transfer Protocol, the Post Office Protocol, and the Internet Message Access Protocol.
Even though MIME was created for email, it is also used in other ways to send information over the Internet. For example, when you look at websites using the Hypertext Transfer Protocol or HTTP, servers use MIME headers to tell your computer what kind of information it is sending, like a picture or a webpage. This helps your computer know how to show the information correctly.
History
MIME started from the Andrew Messaging System. This system was part of the Andrew Project, created at Carnegie Mellon University (CMU). It was made to work across different platforms, offering an alternative to a special data format used only by Andrew.
MIME header fields
MIME-Version
When an email uses MIME, it includes a special header called MIME-Version. This usually shows the number "1.0". The number helps tell other computers that the email follows MIME rules.
Content-Disposition
MIME was made to describe how emails are put together, but it didn’t say how parts should be shown. Later, a new rule called Content-Disposition was added. This helps decide if a part of the email should show up right away (inline) or if the person needs to choose to open it (attachment). It can also give the file name.
Content-Transfer-Encoding
MIME has ways to change binary data (like pictures or music) into text so it can travel safely over the internet. The Content-Transfer-Encoding header tells the email program how the data was changed. Common ways are:
- 7bit – the default, uses only simple text characters.
- quoted-printable – good for text with a few special characters.
- base64 – good for pictures, music, and other non-text files.
These methods help make sure files can be sent and received correctly.
Encoded-Word
Since RFC 2822, email headers use ASCII characters. If you need to use characters that are not ASCII, you can use a special format called encoded-word (from RFC 2047). This format helps show non-ASCII characters by turning them into a string of ASCII characters.
The format looks like this: "=?charset?encoding?encoded text?=".
- charset is the character set used, like the one in the message body.
- encoding can be "
Q" for Q-encoding, which is similar to quoted-printable, or "B" for base64 encoding. - encoded text is the text that has been changed using the chosen encoding.
- An encoded-word cannot be longer than 75 characters. If you need more space, you can use several encoded-words separated by a line break and a space.
The encoded-word format has some special rules. For example, the characters "?" and "=" cannot be used directly because they are part of the format. The underscore (“_”) is used instead of a space, so a space cannot be used directly either.
For example:
Subject: =?iso-8859-1?Q?=A1Hola,_se=F1or!?=
This means the subject is “¡Hola, señor!”.
Header names like “Subject” are always in ASCII and usually in English, even if the email client is in another language. The client might translate these names for the user.
Multipart messages
Multipart messages in MIME allow emails to have more than one part. Each part can be a different type of content, like text, pictures, or files. These parts are separated by a special marker called a boundary. This helps email programs understand where one part ends and another begins.
There are several types of multipart messages. One common type is "mixed," which is used for sending different kinds of files together. Another type is "alternative," which lets emails include both plain text and HTML versions, so they look good on all devices. These different types help make sure emails display correctly for everyone.
Related articles
This article is a child-friendly adaptation of the Wikipedia article on MIME, available under CC BY-SA 4.0.
Safekipedia