logo
search
Attachment Issues

How to Fix HTML Source Code Display in Outlook 2016

Ayan MasoodAyan Masood Oct 15, 2026 869 views

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.

How to Fix HTML Source Code Display in Outlook 2016
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the file in Notepad

Right-click your HTML file on your computer, select 'Open with', and choose 'Notepad'.

2
Save with UTF-8 Encoding

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'.

3
Save and replace

Click 'Save' and confirm that you want to replace the existing file.

4
Test by dragging into Outlook

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.

Verify HTML Validity and Save File as UTF-8
Tip: Testing the HTML file in Microsoft Word before moving it to Outlook can help isolate the issue, as both programs use the same text rendering engine.
Free Microsoft Office alternative

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. 1. Download WPS Office: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install the Suite: Run the installer to set up WPS Writer, Spreadsheet, and Presentation in just a few clicks.
  3. 3. Create and Edit Seamlessly: Open WPS Writer to effortlessly edit your text and HTML documents with full format compatibility.
Highly compatible with Microsoft Word, Excel, and PowerPoint formats.Easily create and edit text documents without facing unexpected file encoding errors.Lightweight software architecture that runs smoothly on almost any device.Familiar user interface for seamless migration from other office software.
QA img-9

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.