Looking to trace spam or curious what’s going on behind a message’s scenes? Find out here how to view the original source code for an email message in Gmail (including all MIME parts, attachments, and tracking headers).
First, It’s Dog Smelling Time
Scents, like memories, fade when they are not recreated.
Dogs, as it happens, are particularly adept at smelling, and chances are they use fading scents to tell the time. The weaker a smell is, the more time has passed.
Unlike a dog’s owner’s favorite scarf, emails do not smell… unless, of course, when they smell funny and phishy.
Just like scarves carry scents, emails do carry marks of their history, though. Every server that handled a message left its mark, for example, and to examine these marks, you’d view an email’s source in Gmail.
Let’s get to it:
How to View the Email Message Source in Gmail (“Show Original”)
Gmail in a Desktop Browser
Time needed: 3 minutes
To view an email message’s source—complete with all header lines and encoded attachments—in Gmail on the desktop:
- Open the email whose message source you want to view.
- Click the More three dots menu () in the message’s header area.
Gmail conversation view: In a conversation, expand the email whose source you want to see to reveal the menu.
Works everywhere: This works in the Gmail reading pane or with an email open in its own separate browser window. - Select Show original from the menu that has appeared.
- Find the message source in the text area at the bottom.
Save as EML: Click Copy to clipboard to copy the message source and click Download Original to save the message as an EML file.
On a Mobile Device
To access message sources on mobile devices such as phones, the quickest way is through basic HTML Gmail:
- Open simple HTML Gmail in a mobile browser.
- Tap I’d like to use HTML Gmail.
- Find and open the message.
Gmail search: Do use search, of course, if the email is not right at hand. - Tap Show original in the message’s header area.
How to View the Email Message Source in Gmail (“Show Original”): FAQ
Can Gmail show the HTML source of the email?
Yes.
The email’s HTML source is typically hidden, though, and possibly twice:
- First, many email messages use the multi-part MIME format and include plain-text as well as an HTML equivalent (and, in theory, other formats more).
Identify the HTML: The HTML source is in the Content-Type: text/html; section in the email’s source. - Second, the whole email is likely encoded using MIME Base64.
Base64 encoding: Base64 encoding expresses all Unicode characters from the world’s writing systems (plus emoji, of course) using just sixty-four plain text characters.
Base64 decoding: To reveal the HTML, decode the email’s source using a Base64 decoding tool.
How do I use the source to track an email’s origin?
You can trace an email’s source using the Received: lines in the raw header.
Can I view the email source in the Gmail app?
No
The Gmail apps for iOS and Android do not let you view message sources directly.
You can open the original message in a mobile browser, however. (See above.)
Can I see the source in basic HTML Gmail?
Yes.
To access an email’s source code in simple HTML Gmail:
- Open the message.
- Follow the Show original link in the heading area.
(How to show the original email source code for tested with Gmail in desktop and mobile browsers; first published April 2020, last updated April 2024)