Open Standard · RFC 2822 · MIME

The EML File
Everything Guide

What is an EML file? Where did it come from? What's inside it? And how do you use one? — Complete breakdown plus a free viewer & composer.

01 — What is it?

The EML File Format

01 Definition

Electronic Mail Format

EML stands for Electronic Mail. It is a file format used to store individual email messages in a standardized plain-text structure. An EML file is essentially a saved snapshot of a single email — complete with all its headers, body text, HTML content, and attachments encoded within a single file.


Think of it as a "frozen email" — everything that was in that email at the time of saving, preserved in an open, portable, human-readable format that any compliant email client can open.

02 Extension

.eml

Files use the .eml extension. They are plain UTF-8 / ASCII text files that follow the MIME standard, meaning you can open them in any text editor — though a proper viewer renders them beautifully.

📜 Standard

RFC 2822

Defined by the Internet Engineering Task Force (IETF) in RFC 2822 (superseding RFC 822). The MIME extensions are defined in RFC 2045–2049.

💾 Storage

One File = One Email

Unlike PST (Outlook) or MBOX (which store many emails), each EML file holds exactly one email message — making them easy to share, archive, and audit individually.

🔓 Open

Universally Open

No vendor lock-in. Works with Outlook, Thunderbird, Apple Mail, Gmail (import), Evolution, Mutt, and dozens of other clients. Plain text at heart.

02 — How to Read It

How to Understand
an EML File

Layer 1

🦴 The Skeleton — Headers

Every EML starts with headers: key-value pairs separated by a colon. They contain routing metadata — who sent it, who receives it, when, with what mail server, and more. Headers end at the first blank line.


Headers you'll always see: From:, To:, Subject:, Date:, Message-ID:. There are dozens of optional headers like X-Mailer:, DKIM-Signature:, and Received: chains.

Layer 2

🦵 The Flesh — Body

After the blank line comes the body. For simple emails this is just plain text. For rich emails it's a MIME multipart structure, encoding text/plain, text/html, and attachments as separate "parts" divided by boundary strings.


Each body part has its own mini-header declaring its content type and encoding (base64, quoted-printable, or 7bit).

Reading an EML — Mental Model
Step 1
Find the blank line
Everything before the first empty line = headers. Everything after = body.
Step 2
Check Content-Type
If it says multipart/*, look for a boundary= parameter — that's your divider string.
Step 3
Split by boundary
Each section separated by --boundary is an independent part with its own headers and content.
Step 4
Decode each part
Use Content-Transfer-Encoding to decode: base64-decode attachments, QP-decode headers, render HTML.
03 — Origin Story

Version History &
Who Made This

🧑‍💻 Creators

IETF Working Groups

The EML format was not invented by a single person — it evolved through IETF (Internet Engineering Task Force) working groups, especially the IMF (Internet Message Format) and MIME working groups throughout the 1980s–2000s.

1973

Email Header Conventions — ARPANET

RFC 561 defined the earliest conventions for email header fields on ARPANET. The "From:", "Date:", "Subject:" pattern was born here.

1982

RFC 822 — Standard for the Format of ARPA Internet Text Messages

Dave Crocker & co. standardized the header format that all modern email still uses. This is the direct ancestor of .eml.

1992–1996

MIME — RFC 2045 to 2049

Nathaniel Borenstein & Ned Freed invented MIME (Multipurpose Internet Mail Extensions) — adding support for binary attachments, HTML bodies, and non-ASCII characters inside emails.

2001

RFC 2822 — Internet Message Format

P. Resnick updated and clarified RFC 822 for the modern internet. This is the primary spec that .eml files implement today.

2008

RFC 5322 — Current Standard

The current authoritative specification for the Internet Message Format, obsoleting RFC 2822. Still fully backwards compatible with all existing .eml files.

Today

Universal Adoption

Used by every major email client. Outlook, Thunderbird, Apple Mail all export to .eml. The format is 50+ years old and shows no signs of being replaced for archiving.

04 — Format & Structure

Inside an EML File —
Anatomy & Purpose

1━━━━━━ SECTION 1: TRANSPORT HEADERS (routing metadata) ━━━━━━
2Return-Path: <alice@example.com>
3Received: from mail.example.com ([203.0.113.1]) by mx.host.com
4         with ESMTPS id abc123; Fri, 20 Jun 2025 10:00:00 +0000
5DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=mail; ...
6
7━━━━━━ SECTION 2: MESSAGE HEADERS (human-visible fields) ━━━━━━
8From: Alice Smith <alice@example.com>
9To: Bob Jones <bob@example.org>
10Cc: team@example.com
11Subject: =?UTF-8?Q?Project_Update_=E2=80=94_June?=
12Date: Fri, 20 Jun 2025 10:00:00 +0000
13Message-ID: <CABc123xyz@mail.example.com>
14MIME-Version: 1.0
15Content-Type: multipart/mixed;
16    boundary="----=_Part_001_123456789"
17
18━━━━━━ SECTION 3: BLANK LINE (divides headers from body) ━━━━━━
19
20━━━━━━ SECTION 4: MULTIPART BODY ━━━━━━
21------=_Part_001_123456789
22Content-Type: multipart/alternative; boundary="----=_Alt_002"
23
24------=_Alt_002
25Content-Type: text/plain; charset=UTF-8
26Content-Transfer-Encoding: quoted-printable
27
28Hi Bob, here is the project update for June...
29
30------=_Alt_002
31Content-Type: text/html; charset=UTF-8
32Content-Transfer-Encoding: quoted-printable
33
34<html><body><p>Hi Bob, here is the <b>project update</b>...</p></body></html>
35
36------=_Alt_002-- <-- double dash = end of this multipart section
37
38------=_Part_001_123456789
39Content-Type: application/pdf; name="report.pdf"
40Content-Transfer-Encoding: base64
41Content-Disposition: attachment; filename="report.pdf"
42
43JVBERi0xLjQKJeLjz9MKNiAwIG9iago8PCAvTGluZWFyaXplZCAxIC9MIDk5...
44        ^ Binary file data encoded as base64 ASCII-safe text
45
46------=_Part_001_123456789-- <-- end of entire message

Transport Headers Added by mail servers as the email travels hop-to-hop. Received: traces the route; DKIM-Signature: verifies authenticity; Return-Path: says where bounces go.

Message Headers Set by the sender's mail client. From, To, Subject, Date, Message-ID are the canonical five. MIME-Version and Content-Type describe how the body is structured.

Boundary Strings A unique string generated per email that separates MIME parts. Must not appear inside any body content. Prefixed with --; the final boundary ends with --.

Content-Transfer-Encoding Tells the receiver how to decode each part. base64 for binary data, quoted-printable for text with special characters, 7bit for plain ASCII.

multipart/alternative Used to send both plain text and HTML versions of the same email. The receiver's client picks the richest version it can render — HTML preferred, plain-text fallback.

multipart/mixed Used when there are attachments. Contains the message body (possibly itself a multipart/alternative) plus one or more attachment parts. The outermost wrapper.

05 — Purpose

What is EML Actually For?

📦 Primary Purpose

Email Archiving & Portability

The core purpose of EML is to store email messages in a standard, interoperable format that isn't tied to any specific email client or vendor. It solves the portability problem — you can move emails between Outlook, Thunderbird, Apple Mail, and any other compliant client by exporting/importing .eml files.


This also makes EML the format of choice for legal holds, compliance archiving, and eDiscovery — you get a portable, court-admissible snapshot of each email message.

🔍 Secondary Purpose

Forensic Inspection & Debugging

Since EML files are plain text, security researchers and email administrators can open them and inspect every header to trace email routing, verify DKIM signatures, identify spoofing attempts, and debug deliverability issues.


Mail server logs tell you what happened at your server. EML files tell you what the email looked like in full fidelity — headers, content, and all.

🧪 Dev Use

Email Template Testing

Developers use EML files to test email rendering across different clients without sending real emails. Write an EML, open it in Outlook AND Thunderbird AND Apple Mail, check consistency.

⚖️ Legal

Legal Evidence & eDiscovery

Courts and compliance teams accept EML as a standard format for email evidence. The full header chain proves authenticity and timestamps routing through each mail server.

🤖 Automation

Programmatic Email Processing

Python's email module, Node's mailparser, and dozens of libraries parse EML files directly — enabling automated data extraction, spam analysis, and email pipeline testing.

06 — Beyond Email

Where EML is Used
(Besides Email Clients)

🗄️

Email Archiving Systems

Enterprise archiving platforms (Mimecast, Proofpoint, Barracuda) store every email as an EML file internally for long-term retention and compliance retrieval.

🕵️

Digital Forensics

Investigators extract EML files from seized devices to reconstruct email communications in legal cases without needing the original email client installed.

🤖

CI/CD Email Testing

Tools like Mailhog and Mailpit catch outgoing emails from web apps as .eml files — letting QA teams inspect rendered HTML, headers, and attachments in automated tests.

📊

Spam / Phishing Research

Security researchers collect malicious emails as EML files for analysis. Sandboxes ingest EML files to extract URLs, attachments, and social engineering patterns.

💼

CRM & Help Desk Systems

Zendesk, Freshdesk, and Salesforce can import EML files to reconstruct customer email threads directly into tickets — preserving formatting and attachments.

💻

Email Migration Tools

Tools like Aid4Mail, Emailchemy, and MailMate use EML as a universal intermediate format when migrating mailboxes between services (Gmail → Outlook, etc.).

📰

Newsletter Platforms

Litmus, Email on Acid, and similar platforms accept EML uploads to test rendering across 90+ email client and device combinations before sending campaigns.

📝

Document Management

SharePoint and similar DMS platforms can store EML files as documents, allowing emails to be filed alongside related contracts and project files.

Ready to Use the Tools?

Parse any .eml file into a clean readable view, or build a valid EML file from scratch — all in your browser, no upload to servers.