Home
Knowledge Base
Credits
Site Map
 

Mail Message Formats and MIME


When an email message is sent from one person to another, a header containing peripheral
information precedes the body of the message itself. This peripheral information is
contained in a series of header lines. As with HTTP, each header line contains readable text,
consisting of a keyword, followed by a colon, followed by a value. Every header must have
a From: header line and a To: header line; a header may include a Subject: leader line as well
as other optional header lines. Note that these header lines are different from the SMTP
commands. The commands in that section were part of the SMTP handshaking protocol;
the header lines examined in this section are part of the mail message itself. After the
message header, a blank line follows; then the message body follows. Use Telnet to send a
message to a mail server that contains some header lines. To do this, issue telnet
serverName 25.

The MIME Extension for Non-ASCII Data: Message headers are satisfactory for sending
ordinary ASCII text; however, they are not sufficient for rich multimedia messages or for
carrying non-ASCII text formats. To send content other than ASCII text, the sending user
agent must include additional headers in the message. The two key MIME headers for
supporting multimedia are the Content-Type header and the Content-Transfer-Encoding:
header. The Content-Type header allows the receiving user agent to take an appropriate
action on the message. By indicating that the message body contains a JPEG image, the
receiving user agent can direct the message boy to a JPEG decompression routine.

The Content-Transfer-Encoding: header alerts the receiving user agent that the message
body has been ASCII-encoded and indicated the type of first uses the value of the Content-
Transfer-Encoding: header to convert the message body to its original non-ASCII form, and
then uses the Content-Type header to determine what actions it should take on the message body. Another popular encoding technique is quoted-printable content-transfer-encoding,
which is typically used to convert an 8-bit ASCII message to a 7-bit ASCII.

The receiving server, upon receiving a message with RFC and MIME header lines, appends
a Received: header line to the top of the message; this header line specifies the name of the
SMTP server that sent the message, the name of the SMTP server that received the message,
and the time at which the receiving server received the message. You may have noticed that
a single message sometimes has multiple Received: header lines and a more complex
Return-Path: header line. This is because a message may be forwarded to more than one
SMTP server in the path between sender and recipient.