How to Fix HTML Source Code Display in Outlook 2016
Question details
The user needs to fix an issue where an HTML file inserted as text into an Outlook message displays as raw code or prompts for encoding.

- Product
- Microsoft Outlook 2016
- Device & OS
- not provided
- Scenario
- Inserting an HTML file created in Notepad as text into a new Microsoft Outlook 2016 email message.
- Observed behavior
- The HTML file fails to render properly, instead displaying as raw HTML source code or triggering an unexpected file conversion encoding prompt, despite working correctly in a web browser.
Ensure your HTML code contains valid, standard structural tags (such as <html>, <head>, and <body>) and that you are using the latest updated version of Outlook 2016.
Verify HTML Validity and Save File as UTF-8
Saving your Notepad file with UTF-8 encoding ensures that Outlook can correctly interpret the characters and HTML formatting instead of treating it as raw text.
Outlook and Microsoft Word rely heavily on strict file encoding standards to parse HTML. If the file is saved with ANSI or another legacy encoding, Outlook may fail to render the markup and instead display the source code or ask for encoding specifics.
Right-click your HTML file on your computer, select 'Open with', and choose 'Notepad'.
Click 'File' in the top menu, then select 'Save As'. At the bottom of the Save dialog box, click the 'Encoding' drop-down menu and select 'UTF-8'.
Click 'Save' and confirm that you want to replace the existing file.
Open a new email message in Outlook 2016. Drag and drop the newly saved HTML file into the message body to see if it renders properly.

Bypass the File Conversion Dialog
Sometimes Outlook triggers an encoding prompt unnecessarily; canceling the prompt can force the system to attempt loading the default HTML view.
Experience Seamless Document Creation with WPS Office
While troubleshooting complex Microsoft Office encoding issues can be frustrating, using a streamlined office suite can improve your daily workflow. WPS Office is a free, lightweight, and highly compatible alternative that makes creating, editing, and managing your text and document files completely effortless.
- 1. Download WPS Office: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install the Suite: Run the installer to set up WPS Writer, Spreadsheet, and Presentation in just a few clicks.
- 3. Create and Edit Seamlessly: Open WPS Writer to effortlessly edit your text and HTML documents with full format compatibility.

Frequently Asked Questions
Why does Outlook display my HTML as raw source code?
This usually happens when the HTML file lacks standard structure tags (like <html> and <body>), or if the file was saved using an encoding format (like ANSI) that the Outlook rendering engine cannot natively interpret as rich text.
How do I properly insert HTML content into an Outlook email body?
Instead of using the 'Insert as Text' feature, try opening your HTML file in an internet browser. Highlight the rendered page content, copy it (Ctrl+C), and paste it directly into the body of your Outlook message (Ctrl+V).
What is the best encoding format for HTML files used in Outlook?
UTF-8 is the universally recommended standard. It ensures maximum compatibility across different text editors, web browsers, and email clients like Outlook 2016.




