Whether you want to inspect how an email was built, debug rendering issues, or analyze the HTML structure of a received message, viewing the EML code is the starting point. This guide explains what EML code actually is, how it relates to HTML, and how to access the raw email source from Gmail, Yahoo, and Outlook.
What is EML Code?
An EML file is the standard file format for storing individual email messages. The term "EML code" refers to the raw text content inside that file - everything from the message headers down to the HTML markup of the email body.
When an email arrives in your inbox, your email client downloads and renders it. The EML file is what gets stored. It contains:
- MIME headers - From, To, Subject, Date, Message-ID, and routing information
- Content-Type declarations - telling the email client whether the body is plain text, HTML, or multipart
- The email body - usually both a plain text version and an HTML version separated by MIME boundaries
- Attachments - encoded in Base64 within the file
EML files are created by email clients like Microsoft Outlook, Apple Mail, and Mozilla Thunderbird, and are the format you get when you export or download a message from Gmail or Yahoo Mail. Opening the raw EML code lets you see exactly what was sent - headers, HTML structure, tracking pixels, and all.
EML vs HTML: What's the Difference?
EML and HTML are related but serve different purposes. The simplest way to understand the difference is: EML is the container, HTML is the content inside it.
| EML | HTML |
|---|---|
| File format for storing a complete email message | Markup language used to format the email body |
| Contains headers, metadata, body parts, and attachments | Contains only the visual structure and styling of the message |
| Opened by email clients (Outlook, Thunderbird, Apple Mail) | Rendered by email clients and web browsers |
| Extension: .eml | Extension: .html or .htm |
| Can contain multiple body parts (plain text + HTML) | Is one of those body parts - the formatted version |
When you open an EML file in a text editor, you see raw EML code - a mix of headers and MIME structure. When an email client opens the same file, it extracts the HTML part and renders it visually. The HTML inside an EML file follows the same syntax as web HTML but is typically limited to inline styles and table-based layouts for cross-client compatibility.
How to View Email HTML in Gmail
Gmail's "Show original" option exposes the full EML code for any received message, including all headers and the raw HTML body.
-
Open the email - Log in to your Gmail account and open the specific email whose HTML code you want to view.
-
Access "Show Original" - Click the three-dot (More) menu in the top-right corner of the email and select Show original. This opens a new page with the raw email content.
-
Download the EML file - On the "Original Message" page, click Download Original to save the email as a .eml file.
-
Copy to clipboard - Alternatively, click Copy to clipboard on the same page to copy the entire raw content including headers and HTML.
-
View the HTML - Open the .eml file in a text editor to read the raw code, or paste it into our EML to HTML Converter to decode Base64-encoded content and render the HTML visually.
How to View Email HTML in Yahoo Mail
Yahoo Mail provides a "View raw message" option that displays the complete EML source code directly in the browser.
-
Open Yahoo Mail - Go to Yahoo Mail in your browser and log in to your account.
-
Open the email - Navigate to the inbox or folder containing the email and click to open it.
-
View raw message - Click the three-dot (More) menu in the top-right corner and select "View raw message". This shows the full email source including HTML code.
-
Download the EML file - Right-click the page and select Save as, then name the file with a .eml extension (for example: email-name.eml).
-
View the HTML - Open the saved file in a text editor, or use our EML to HTML Converter to decode and render the HTML.
How to View Email HTML in Outlook
Outlook on the web provides a "View Message Source" option. The desktop app uses a slightly different path but exposes the same raw EML content.
-
Open Outlook - Launch the Outlook desktop app or open Outlook.com / Office 365 in your browser.
-
Open the email - Go to your inbox, find the email, and double-click to open it in a new window.
-
View message source (Outlook on the web) - Click the three-dot (More) menu in the top-right corner, select "View", then "View Message Source". This displays the full raw email source including HTML.
-
Download as EML file - Click the three-dot menu, select "View", then "Save as" to save the message as an EML file.
-
View the HTML - Open the EML file in a text editor or paste the content into our EML to HTML Converter to render and inspect the HTML.
How to Convert EML to HTML
Raw EML files contain Base64-encoded content that is not human-readable in a text editor. The HTML body of an email is encoded in Base64 inside the EML file, which means you see a long string of random-looking characters rather than actual HTML tags.
An EML to HTML converter decodes that Base64 content, extracts the HTML part of the email, and renders it so you can read and inspect the actual markup. This is the fastest way to view email HTML without manually decoding the Base64 string.
Free EML to HTML Converter
Upload or paste your EML file. Campaign Cleaner decodes the Base64 content, extracts the HTML, and renders it immediately - no signup required.
Open EML to HTML ConverterOnce you can view the email HTML, you can also run it through Campaign Cleaner to identify HTML issues that affect deliverability - oversized code, missing ALT tags, broken CSS inlining, spam-trigger phrases in the HTML, and more. Understanding the raw EML code is step one; making sure that code is clean and deliverable is step two.
Frequently Asked Questions
What is EML code?
EML code refers to the raw source content of an EML file - a standard file format for storing individual email messages. It contains MIME headers (From, To, Subject, Date), the HTML body of the email, a plain text alternative, and any Base64-encoded attachments. The HTML inside an EML file is the actual markup that email clients render into the formatted email you see in your inbox.
What is the difference between EML and HTML?
EML is the container format that wraps the entire email - headers, metadata, and body parts. HTML is the markup language used to format the visual content of the email body inside that container. When you open an EML file in a text editor you see the full EML code including headers. When an email client opens it, it extracts and renders just the HTML part.
How do I view the HTML of an email?
In Gmail: open the email, click the three-dot menu, select "Show original", then "Download original". In Yahoo: click the three dots and select "View raw message". In Outlook on the web: click the three dots, select "View", then "View Message Source". Once you have the EML file, open it in a text editor or use the free EML to HTML Converter at campaigncleaner.com/tools/emltohtml/ to decode and render it.
How do I convert an EML file to HTML?
Use Campaign Cleaner's free EML to HTML Converter. Upload or paste your EML file and the tool decodes the Base64-encoded content, extracts the HTML body, and renders it as a readable web page. This is faster than manually decoding Base64 in a text editor and works for emails from Gmail, Yahoo, Outlook, and any other email client.
How do I view email as HTML in Gmail?
Open the email in Gmail, click the three-dot menu in the top-right corner, and select "Show original". On the Original Message page, click "Download original" to save the .eml file, or "Copy to clipboard" to copy the raw content. Open the file in a text editor to see the HTML source, or paste it into the EML to HTML Converter to render it visually.