.EML
Email message
Introduction
An EML file is one email message saved exactly as it travels between mail servers: the header lines, then the body, with any attachments encoded as text. The layout is the Internet Message Format, now RFC 5322, which goes back to RFC 822 from 1982, together with the MIME standards that added attachments, other character sets and messages in several parts. Mail programs save and open single messages in this form, and many can import a folder of them.
Software
- Mozilla Thunderbird (Windows, macOS, Linux)
- Microsoft Outlook (Windows, macOS)
- Apple Mail (macOS)
- Any text editor, such as Notepad++, which shows the raw message
Structure
The file is text with lines ending in a carriage return and line feed. It starts with
header fields, one per line in the form Name: value, such as
From, To, Subject, Date and
Message-ID. A long field continues on lines that start with a space or a
tab. Text outside plain ASCII is written as an encoded word, such as
=?UTF-8?B?…?=.
An empty line ends the header, and the body follows. MIME fields say how to read it:
Content-Type gives its type and character set, and
Content-Transfer-Encoding says whether it is plain, quoted-printable or
base64. A multipart body is split into parts by a boundary line named in
the header; each part has its own header fields and body, and parts can be nested. This
is how a message carries a plain text version, an HTML version and attachments
together.
0Header fields From, To, Subject, Date, MIME fieldslines…Empty line2 bytes…Body text, or MIME parts between boundary linesthe rest…Part its own header fields, an empty line, its contentrepeated