The Spamhaus Project
BETA

guide

How to successfully access your email source code

Learn how to access email source code using different email clients and the type of information you can find to help identify malicious emails associated with spam and phishing attempts.

by The Spamhaus TeamSeptember 12, 20234 minutes reading time

Jump to

Introduction

Email source code contains a wealth of information about an email message. Information that can be very useful in identifying malicious emails, associated with spam and phishing attempts. Learn how to access email source code using different email clients and the type of information you will find.

When an end-user views an email, it isn't always clear if it's malicious or not. However, by looking at the email's source code, you can see important information about the sender, recipient, server routing and more. This information is not usually visible in your inbox but can be accessed through your email client. If you know how….  

How to access email source code

According to the latest data, as of March 2023, the most used email clients worldwide are:

  • Apple (58.96%)
  • Gmail (28.04%)
  • Microsoft Outlook (4.21%)

Unsurprisingly, the steps to view an email source code vary depending on the provider. Why make it easy, right?

To help, we have provided step-by-step instructions on how to access email source code for the above three most popular email clients.  

View email source code in Apple Mail

Below are the steps to view email source code in Apple Mail:

  • Go into Apple Mail.

  • Select the email you want to investigate.

  • Go to ‘View’ > ‘Message’ > ‘Raw Source’.

  • This will open up the email's source code in a separate window where you can copy, print or save it.

  • Alternatively, hit Option-Command-U on your keyboard!  

View email source code in Gmail

  • Below are the steps to view email source code in Gmail:
  • Log in to Gmail.
  • Select the email you want to investigate.
  • Open the email and select the three-dotted menu on the right.
  • Select ‘Show original’.
  • This will open up the email's source code in a new tab where you can copy, print or save it.  

View email source code in Microsoft Outlook

Below are the steps to view email source code in Microsoft Outlook desktop and .com:

DesktopItalic

  • Go to the Outlook desktop application.
  • Select the email you want to investigate.
  • Go to ‘Actions’ > ‘View Message Source’.
  • This will open up the email's source code in a separate window where you can copy, print or save it.

You can also access the source code by right-clicking on an email in your inbox (before you open it) and selecting ‘View Message Source’.

Outlook.comItalic

  • Log in to outlook.com.
  • Select the message you want to investigate.
  • Select the three-dot menu on the right.
  • Select ‘View’ > ‘View message source’.
  • This will open up the email's source code in a pop-up where you can copy, print or save it.

For any other email clients, search online for instructions. Check out spamcop.net for a head start!  

What information can you find in email source code?

Here is some of the vital information you will find in the source code of an email:

Date and time – timestamp of when the email was sent. Reply-To address – the email address that should be entered into the "To" field when you click "Reply" to an email. Sender-Address – the Friendly-From name, visible to an end-user, typically including the sender’s name and email address. **Subject **– topic or purpose of the email. Received chain – a route of all the email servers - with IP addresses or domain names - that have handled your email, including your mail server. Return-Path – the “actual” email address that sent the email. Message transfer agents (MTAs) – a list of MTAs involved in the delivery of the email. Email protocols – the protocols used for sending and receiving the email, such as SMTP (Simple Mail Transfer Protocol).

As you can see, a considerable amount of information is contained within email source code. How to find it and what the end user sees is only the tip of the iceberg. The real challenge is interpreting the source code, to better understand an emails intention. But fear not! You can read more about understanding the source code of a malicious email here.