The basic Internet message format used for email is defined by , with encoding of non-ASCII data and multimedia content attachments defined in RFC 2045 through RFC 2049, collectively called
Multipurpose Internet Mail Extensions or
MIME. The extensions in
International email apply only to email. RFC 5322 replaced RFC 2822 in 2008. Earlier, in 2001, RFC 2822 had in turn replaced RFC 822, which had been the standard for Internet email for decades. Published in 1982, RFC 822 was based on the earlier RFC 733 for the ARPANET. Internet email messages consist of two sections, "header" and "body". These are known as "content". The header is structured into
fields such as From, To, CC, Subject, Date, and other information about the email. In the process of transporting email messages between systems, SMTP communicates delivery parameters and information using message header fields. The body contains the message, as unstructured text, sometimes containing a
signature block at the end. The header is separated from the body by a blank line.
Message header RFC 5322 specifies the
syntax of the email header. Each email message has a
header (the "header section" of the message, according to the specification), comprising a number of
fields ("header fields"). Each field has a name ("field name" or "header field name"), followed by the separator character ":", and a value ("field body" or "header field body"). Each field name begins in the first character of a new line in the header section, and begins with a non-
whitespace printable character. It ends with the separator character ":". The separator is followed by the field value (the "field body"). The value can continue onto subsequent lines if those lines have space or tab as their first character. Field names and, without
SMTPUTF8, field bodies are restricted to 7-bit ASCII characters. Some non-ASCII values may be represented using MIME
encoded words.
Header fields Email header fields can be multi-line, with each line recommended to be no more than 78 characters, although the limit is 998 characters. Header fields defined by RFC 5322 contain only
US-ASCII characters; for encoding characters in other sets, a syntax specified in RFC 2047 may be used. In some examples, the IETF EAI working group defines some standards track extensions, replacing previous experimental extensions so
UTF-8 encoded
Unicode characters may be used within the header. In particular, this allows email addresses to use non-ASCII characters. Such addresses are supported by Google and Microsoft products, and promoted by some government agents. The message header must include at least the following fields: •
From: The email address, and, optionally, the name of the author(s). Some email clients are changeable through account settings. •
Date: The local time and date the message was written. Like the
From: field, many email clients fill this in automatically before sending. The recipient's client may display the time in the format and time zone local to them. RFC 3864 describes registration procedures for message header fields at the
IANA; it provides for permanent and provisional field names, including also fields defined for MIME, netnews, and HTTP, and referencing relevant RFCs. Common header fields for email include: •
To: The email address(es), and optionally name(s) of the message's recipient(s). Indicates primary recipients (multiple allowed), for secondary recipients see Cc: and Bcc: below. •
Subject: A brief summary of the topic of the message.
Certain abbreviations are commonly used in the subject, including
"RE:" and "FW:". •
Cc:
Carbon copy; Many email clients mark email in one's inbox differently depending on whether they are in the To: or Cc: list. •
Bcc:
Blind carbon copy; addresses are usually only specified during SMTP delivery, and not usually listed in the message header. •
Content-Type: Information about how the message is to be displayed, usually a
MIME type. •
Precedence: commonly with values "bulk", "junk", or "list"; used to indicate automated "vacation" or "out of office" responses should not be returned for this mail, e.g. to prevent vacation notices from sent to all other subscribers of a mailing list.
Sendmail uses this field to affect prioritization of queued email, with "Precedence: special-delivery" messages delivered sooner. With modern high-bandwidth networks, delivery priority is less of an issue than it was.
Microsoft Exchange respects a fine-grained automatic response suppression mechanism, the
X-Auto-Response-Suppress field. •
Message-ID: Also an automatic-generated field to prevent multiple deliveries and for reference in In-Reply-To: (see below). •
In-Reply-To: Message-ID of the message this is a reply to. Used to link related messages together. This field only applies to reply messages. •
List-Unsubscribe: HTTP link to unsubscribe from a mailing list. •
References: Message-ID of the message this is a reply to, and the message-id of the message the previous reply was a reply to, etc. • '''': Address should be used to reply to the message. •
Sender: Address of the sender acting on behalf of the author listed in the From: field (secretary, list manager, etc.). •
Archived-At: A direct link to the archived form of an individual email message. The
To: field may be unrelated to the addresses to which the message is delivered. The delivery list is supplied separately to the transport protocol,
SMTP, which may be extracted from the header content. The "To:" field is similar to the addressing at the top of a conventional letter delivered according to the address on the outer envelope. In the same way, the "From:" field may not be the sender. Some mail servers apply
email authentication systems to messages relayed. Data pertaining to the server's activity is also part of the header, as defined below. SMTP defines the
trace information of a message saved in the header using the following two fields: •
Received: after an SMTP server accepts a message, it inserts this trace record at the top of the header (last to first). •
Return-Path: after the delivery SMTP server makes the
final delivery of a message, it inserts this field at the top of the header. Other fields added on top of the header by the receiving server may be called
trace fields. •
Authentication-Results: after a server verifies authentication, it can save the results in this field for consumption by downstream agents. •
Received-SPF: stores results of
SPF checks in more detail than Authentication-Results. •
DKIM-Signature: stores results of
DomainKeys Identified Mail (DKIM) decryption to verify the message was not changed after it was sent. •
Auto-Submitted: is used to mark automatic-generated messages. •
VBR-Info: claims
VBR whitelisting
Message body Content encoding Internet email was designed for 7-bit ASCII. Most email software is
8-bit clean, but must assume it will communicate with 7-bit servers and mail readers. The
MIME standard introduced character set specifiers and two content transfer encodings to enable transmission of non-ASCII data:
quoted printable for mostly 7-bit content with a few characters outside that range and
base64 for arbitrary binary data. The
8BITMIME and
BINARY extensions were introduced to allow transmission of mail without the need for these encodings, but many
mail transport agents may not support them. In some countries, e-mail software violates by sending raw non-ASCII text and several encoding schemes co-exist; as a result, by default, the message in a non-Latin alphabet language appears in non-readable form (the only exception is a coincidence if the sender and receiver use the same encoding scheme). Therefore, for international
character sets,
Unicode is growing in popularity.
Plain text and HTML Most modern graphic
email clients allow the use of either
plain text or
HTML for the message body at the option of the user. HTML email messages often include an automatic-generated plain text copy for compatibility. Advantages of HTML include the ability to include in-line links and images, set apart previous messages in
block quotes, wrap naturally on any display, use emphasis such as
underlines and
italics, and change
font styles. Disadvantages include the increased size of the email, privacy concerns about
web bugs, abuse of HTML email as a vector for
phishing attacks and the spread of
malicious software. Some e-mail clients interpret the body as HTML even in the absence of a Content-Type: html header field; this may cause various problems. Some web-based
mailing lists recommend all posts be made in plain text, with 72 or 80
characters per line for all the above reasons, and because they have a significant number of readers using
text-based email clients such as
Mutt. Various informal conventions evolved for marking up plain text in email and
usenet posts, which later led to the development of formal languages like
setext (c. 1992) and
many others, the most popular of them being
markdown. Some
Microsoft email clients may allow rich formatting using their proprietary
Rich Text Format (RTF), but this should be avoided unless the recipient is guaranteed to have a compatible email client. ==Servers and client applications==