MIME Overview Part I: A brief overview of the MIME specification

What is MIME (Multipurpose Internet Mail Extensions)?

 

Email has become an important, if not critical, part of communication on the internet. When RFC822 was published, email was meant as a simple means of exchanging text messages. At that time there wasn’t a need for attachments, multi-part emails, formatted emails, different rich clients, embedded images, embedded sounds etc. To provide these rich features, a new standard was created, that didn’t break RFC822.

Although a Mime message is considered to have parts, and part can have other parts, a Mime message is still one textual message. A properly formatted Mime (email) message can be opened in notepad, or any text editor. Each part is separated by boundaries.

A graphical representation of a Mime (Email) Message can be found below. In this drawing, the message contains headers, and two Mime parts; Part 1 and Part 2. Part 2, actually consists of two more mime parts; Part 2a, and Part 2b. This demonstrates that each Mime part can have additional children parts.




As an example, here is the text of a Mime message that contains a text and html part, along with some attachments. This mime message actually consists of 6 Mime Parts (as parsed by aspNetMime). Each of these parts are labeled as Mime Index n. Where 'n' is the index number.  The text in red describes the Mime message, but is not actually part of the message.  To see this message in its entirety, as a text message, click here.
 

Mime Index 0 
The Mime (Email) Message

Headers

Received: from test67 [192.168.1.1] by mail.aspNetEmail.com
(SMTPD32-6.00) id A92D66D00DE; Wed, 01 Jan 2003 15:10:05 -0600
Message-ID: <02c501c2b1d7$632f3b80$bd05ec8f@test67>
Reply-To: "aspNetEmail" <support@aspNetEmail.com>
From: "aspNetEmail" <support@aspNetEmail.com>
To: "Dave " <support@aspNetEmail.com>
Subject: My Mime Message
Date: Wed, 1 Jan 2003 14:50:15 -0600
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_02C1_01C2B1A5.184FFA50"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-RCPT-TO: <support@aspNetEmail.com>
X-UIDL: 336533283
Status: U

This is a multi-part message in MIME format.

     Mime Index 1
     This is the first main Mime Part (It consists of three more Mime Parts: A Body, and two(2) attachments.
    
------=_NextPart_000_02C1_01C2B1A5.184FFA50

This Mime Part is the body, and consists of a Text Mime Part and a HTML Mime Part.
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_02C2_01C2B1A5.184FFA50"

     Mime Index 2
     This is the first MimePart of the Body and has a plain text Content-Type.
    
------=_NextPart_001_02C2_01C2B1A5.184FFA50
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

This mult-part email contains two parts, and two attachments.

The two parts are a text part, and a HTML part.

The two attachments are named pic1.gif and pic2.gif.


     Mime Index 3
     This is the second (2nd) MimePart for the body and has a HTML Content-Type.
    
------=_NextPart_001_02C2_01C2B1A5.184FFA50
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2715.400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>This mult-part email contains two =
parts, and two=20
attachments.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The two parts are a text part, and a =
HTML=20
part.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The two attachments are named pic1.gif =
and=20
pic2.gif.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>


------=_NextPart_001_02C2_01C2B1A5.184FFA50--

     Mime Index 4
     This is the first attachment Mime Part
.

     ------=_NextPart_000_02C1_01C2B1A5.184FFA50

Content-Type: image/gif;
name="pic2.gif"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="pic2.gif"

R0lGODlhZAAeAOYAADON3bi4uIyMjOHh4ev0/Pj4+F1dXaqqqrW1tSOF2pycnHNzc8zMzIO66t3s
+Uyb4fz8/Pr6+q2trcnh9ubm5n19fWJiYu/v78TExISEhNjY2Nvb2y6L3NbW1pSUlN7e3qKiotTU
1GZmZrPV8s7OztHR0c7l+9LS0myt5vb29llZWfP4/crKyv7+/vPy8uzs7L6+vsjIyPHw8G

     Mime Index 5
     This is the second (2nd) attachment Mime Part.

    ------=_NextPart_000_02C1_01C2B1A5.184FFA50

Content-Type: image/gif;
name="pic1.gif"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="pic1.gif"

R0lGODlhZAAeAPcAAI+Pj//azv7+/uno6P++qdnZ2evr6/6Zd4yMjLKysri4uPX19dbW1unp6czM
zOjn58XFxc3Nzerp6cLCwq2trerq6v59UqOjo8TExHBwcMjIyOvq6v6HX+Dg4NHR0cPDw8/Pz/Dv


 

    ------=_NextPart_000_02C1_01C2B1A5.184FFA50--