View HTML source code of an email in New Outlook

In Classic Outlook, you were able to view the HTML source of an email. As a designer of templates and newsletters, this is particularly helpful to see how the HTML of an email got through when things don’t line up as expected.

Within New Outlook, I don’t see this feature anymore.

Is the “View Source” command coming to New Outlook as well or will it be removed?

Is there another way to see the HTML tags of an email in New Outlook?

View HTML Code buttonNew Outlook doesn’t have the View Source command (yet?) and at the time of writing it is not listed on the Microsoft 365 Roadmap either.

If the ability to see the HTML tags of an email is important to you, it is highly recommended to provide feedback to the New Outlook team about that as they are constantly evaluating and prioritizing which Classic Outlook features should be kept and brought over next. You can provide feedback directly from within New Outlook;

  • Help-> Feedback-> Make a suggestion

If you need it now, you can still view the HTML source by saving the message as an eml-file first. This works in both New Outlook and Outlook on the Web.

HTML source code within eml-file

Save Email buttonThis workaround may be a little bit cumbersome if you have to do this often, but it is highly effective nonetheless.

  1. In the top right corner of the Reading Pane, next to the respond actions (Reply, Reply All and Forward), open the “More actions” menu (…) to find the “Save as” command.
  2. Save your message in a convenient location as an eml-file.
  3. Open the eml-file within Notepad.
  4. Look for the section starting with Content-Type: text/html to see the tags.

If you don’t see the tags, it could be that the message is Base64 encoded. See the instructions below on how to decode it.

Finding the HTML tags in Notepad after saving the email as an eml-file.
Finding the HTML tags in Notepad after saving the email as an eml-file.

Optional: Convert Base64 email content to HTML tags

PowerShell buttonIn some cases, you'll need to use a Base64 decoder to convert it back to HTML tags. In those case you’ll see the following line below the “Content-Type” line.

  • Content-Transfer-Encoding: base64

If that is the case, you can copy the encoded section and use a website such as base64decode.org to convert it or use PowerShell.

  1. Open the Terminal or Windows PowerShell app.
  2. Type; $string="
  3. Paste the copied base64 encoded content from your email.
  4. Type; "
    • This will close the string definition that you opened in step 2.
  5. Press Enter.
  6. Type;
    • [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($string))
  7. Press Enter.

If done correctly, the output will be the HTML content of your email.

Decoding a Base64 string using Windows PowerShell.
Decoding a Base64 string using Windows PowerShell.

Note:
Other common encoding types which do not need decoding are;

  • Content-Transfer-Encoding: quoted-printable
  • Content-Transfer-Encoding: 8bit

View Source in Classic Outlook

Classic Outlook buttonIn Classic Outlook, you can use one of the following methods to view the HTML source of a message;

  • Right click on “specific spots” within the message and from the Context menu choose; View Source
    • Tip!
      If you don’t see the command in the Context menu, right clicking at the absolute bottom of the message, at the height of the down arrow of the scroll bar (see screenshot below), seems to work most reliably.
  • Open the message in its own window via a double click and from the Message tab choose;
    • Actions-> Other Actions-> View Source

View Source in the Context menu of Classic Outlook.
View Source in the Context menu of Classic Outlook.

MAPILab
Use "4PM76A8" to get a discount when ordering!