How to View the Source of a Message in Apple Mail

Use Mail Source Code to Avoid Spam

The email in your inbox that you open and read is just the tip of the email iceberg. Behind it is the hidden source code of the email that contains an overwhelming amount of information regarding the message, who sent it, how it traveled to you, the HTML used to display it, and other information. In Apple Mail, you can take a look at the source code data for any email quickly.

Instructions in this article apply to Mac OS X Lion (10.7) and later.

How to View the Source of a Message in Apple Mail

Whether it's for identifying the origin of spam or for techy fun, having a look at the raw source of an email message can be interesting. Also, when you or your email provider's customer support department is troubleshooting delivery or content problems, being able to see the entire source code data can be helpful. By studying the expanded header information, you may be able to identify a forged sender or avoid a suspicious phishing effort.

Here's how to see it.

  1. Open an email in the Mail app on your Mac.

  2. Select View > Message > Raw Source from the menu to open the source code in a separate window.

    Alternatively, use the keyboard shortcut Option+Command+U.

    The Raw Source command
  3. The source code will open in a new window.

    Source code for a message in Apple Mail
  4. You can find a wealth of information in the source code, including:

    • the sender's IP address
    • the relay path the email took to reach you
    • the sender's email client

    If you suspect a message is spam, you can use this data to confirm you shouldn't click any links in it. Some red flags are outdated email clients and IP addresses from countries other than the one the sender claims to be from.

  5. To save the source code to your desktop or print it out for further study, use Save as or Print in the File menu.

    The Save As and Print commands