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?
New 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
This workaround may be a little bit cumbersome if you have to do this often, but it is highly effective nonetheless.
- 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.
- Tip!
For more detailed instructions of this step see; Saving emails as eml or msg-file in the New Outlook or OWA.
- Tip!
- Save your message in a convenient location as an eml-file.
- Open the eml-file within Notepad.
- 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.
Optional: Convert Base64 email content to HTML tags
In 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.
- Open the Terminal or Windows PowerShell app.
- Type;
$string="
- Paste the copied base64 encoded content from your email.
- Type;
"
- This will close the string definition that you opened in step 2.
- Press Enter.
- Type;
[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($string))
- Press Enter.
If done correctly, the output will be the HTML content of your email.
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
In 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.
- Tip!
- 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.