How to Send an HTML File by Email (Gmail, Outlook, or Link)
Quick answer
You can attach an .html file in Gmail or Outlook, since neither blocks it by default. Still, some organizations filter HTML attachments, and the file opens however the recipient's mail app decides, such as raw code. To have them see the page, send a link to the published page instead.
Free plan: no credit card, 1 published page, 10,000 page views a month, and a small Convika bar at the bottom.
On this page
- How to send an HTML file by email
- Why an HTML Attachment Won't Open or Shows Code
- Why an HTML email attachment gets blocked or flagged as a virus
- Attach the file or send a link?
- How to send an HTML file as a link in 4 steps
- Add a password and check if your page was opened
- Frequently asked questions
- Sources
You have an .html file—a page an AI built for you, or a coursework file—and you want a teacher, a client, or a relative to open it from an email. You can attach an .html file in Gmail, Outlook, or iPhone Mail just like a regular document, and neither Gmail nor Outlook blocks .htm or .html attachments by default. What happens on the other end is less predictable: a work or school mail server may block or quarantine the attachment, or the recipient may tap it and get raw code, a download prompt, or a page missing its scripts and separate images.
This guide covers how to attach an .html file in Gmail, Outlook, and iPhone Mail, why the attachment sometimes won't open or shows code, and when mail filters block or flag it. You'll also see when sending the file itself is the right choice, how to send the page as a link in 4 steps when you want it to open cleanly in a browser, and how to add a password or check whether it was opened.
How to send an HTML file by email
You can attach a .html file to an email just like any other document, which is different from sending an "HTML email" where the message body itself is formatted with HTML. Note that the file arrives on its own—any images or stylesheets saved in separate files won't come along, and depending on the recipient's device and mail app, it may ask to be downloaded, open without its scripts, or display as raw code.
Gmail
In Gmail, click Compose, click the attach (paperclip) icon at the bottom, choose your .html file, and click Open. Personal Gmail accounts allow up to 25 MB of attachments (Google Workspace admins set the limits for work and school accounts). Gmail does not block .htm or .html files by default, though it does block formats like .hta, .js, and .exe—even inside .zip archives. If your file is blocked or includes .js files, follow Gmail's recommendation: upload it to Google Drive and send it as a Drive attachment.
Outlook
In a new Outlook message, go to the Message tab and select Attach File (in Outlook on the web, you can also drag the file from your computer into the message). Outlook's default blocked attachment list includes .hta, .htc, .mht, and .mhtml, but not .htm or .html. However, on a Microsoft Exchange or Microsoft 365 account, an organization's mail admin can add .htm and .html to their blocked or quarantined list (often because security firms have reported phishing emails using HTML attachments to avoid detection). If your attachment is rejected, Microsoft suggests uploading the file to OneDrive and sharing a link.
iPhone Mail
In iPhone Mail, tap inside the message body, tap the Insert Attachment button above the keyboard, tap Attach File, and select your .html file from the Files app. Because mail apps handle received .html attachments differently—and the recipient may only see raw code—they can save the file and open it in a browser, or view it locally in Convika's free HTML viewer without uploading it (if someone sent you an HTML file, only open it if you trust the sender, and untick Run scripts first to inspect it safely).
Why an HTML Attachment Won't Open or Shows Code
An attached .html file arrives as a file rather than as a formatted "HTML email" body, and how it opens depends on the recipient's mail app and device. When the recipient taps or clicks the attachment, their mail app may display the raw HTML code, show the page with its scripts disabled, or require the file to be downloaded first.
- Mail app preview limits: Depending on the recipient's mail app and device, opening the attachment directly from the message may show raw code, strip out scripts, or prompt a download instead of rendering the page.
- Missing separate files: If your page relies on images or styles saved in separate files, those files are not included when you attach only the .html file.
- Organization security filters: While personal Gmail and Outlook do not block .htm or .html by default, an Exchange or Microsoft Defender for Office 365 admin can configure an organization's mail filter to reject or quarantine HTML attachments, and archiving blocked file types inside a .zip does not bypass Gmail's blocked-file list.
Even after downloading, the page can look broken or fail to arrive at all. Separate image and style files do not travel with a single .html attachment, and some work or school mail servers reject or quarantine HTML attachments because phishing emails have used them to avoid detection. If the recipient saves the file, they can open it in a browser on their device using Convika's free HTML viewer (/tools/html-viewer/) without uploading it—though for a file someone else sent, they should open it only if they trust the sender and untick Run scripts first to look inside.
Why an HTML email attachment gets blocked or flagged as a virus
Neither Gmail nor Outlook blocks .html or .htm attachments on their standard blocked-file lists, though both block related formats—Gmail blocks .hta, .js, and .exe (including inside .zip archives), while Outlook blocks .hta, .htc, .mht, and .mhtml. However, security firms have reported phishing emails that use HTML attachments to evade detection (such as Digital Arts' report covered by INTERNET Watch on September 18, 2019), so work and school administrators often filter them. On a Microsoft Exchange account, a mail admin can change which types are blocked, and in Microsoft Defender for Office 365 an admin can add .htm and .html to the common attachments filter that rejects or quarantines files.
- Check the file extension and any .zip contents: make sure the file is .html or .htm rather than a blocked format like .hta, .mht, or .mhtml, and has no .js or .exe files bundled inside an archive.
- Share a cloud link if a work or school filter rejects the attachment: Gmail suggests uploading blocked files to Google Drive and sending a Drive attachment, and Microsoft suggests sending a OneDrive link.
- Check the file size: personal Gmail accounts allow up to 25 MB of attachments, while Google Workspace and Exchange administrators set their own limits for work and school accounts.
Because of those risks, mail apps and security scanners treat .html attachments with caution even when they are just coursework or an AI-made page. If you receive an HTML file from someone else, open it only if you trust the sender—you can inspect it in Convika's free HTML viewer (/tools/html-viewer/), which opens the file in the browser on your device without uploading it, and untick Run scripts first to look inside safely.
Attach the file or send a link?
You can attach an .html file to an email, or you can publish the page and email the link. Which one works better depends on whether the other person needs to see the finished page or work with the file itself.
| Attach the .html file | Send a link to the published page | |
|---|---|---|
| What arrives | A file | A link in the message |
| How it opens | Up to the recipient's mail app and device | As a page, in their browser |
| Scripts | May not run | Run on every Convika plan |
| Filters | Gmail and Outlook don't block .html; an organization's admin can | No attachment to filter |
| A fix after sending | Send a new file | A new version at the same link |
| Did they open it? | No sign | Visit counts, the last 90 days on Free |
Attaching the .html file is the right call when the other person actually needs the file on their computer—for example, a teacher who asked you to turn in your coursework file for grading, or someone who plans to open the code in an editor and make changes. If you just want a client, relative, or teacher to look at the page in their browser without downloading anything or seeing raw code, send a link instead.
How to send an HTML file as a link in 4 steps
Sending a .html file as an email attachment often fails—email filters may block it, or the recipient opens it on a phone and sees raw code instead of your page. Turning the file into a live web link lets anyone open it right in their browser from Outlook, Gmail, or any other email app.
1. Drop your HTML file into the upload box
Go to the box at the top of this page. With Upload a file selected, drop one .html or .htm file (up to 2 MB) into the box—or switch to Paste code and paste your HTML code. Click Get my preview link. You get a working preview right away with no account and no email required. Note that without an account, the preview link works for 3 minutes and scripts and forms are turned off.
2. Keep the page and check how it looks
To make the link last and turn on interactive features, click Keep this page — free, no card and sign up. Your page moves into your account exactly as you uploaded it, and its scripts now run (including libraries loaded from an https:// CDN). Check your page to make sure everything displays properly: Convika takes one HTML file rather than a folder or a ZIP, so styles and scripts should be inside the file or loaded from https://, and images must use https:// addresses or be built into the file (separate local files like a style.css or an images folder on your computer won't load, and the page can't fetch data from other websites).
3. Publish the page and choose who can open it
On the page's screen, click Publish. The confirmation offers Public, Private link, or a password. Public is free: anyone with the link can open the page without a password or an account (including anyone they forward the email to), and it may show up in search results and in Convika's gallery. A Private link (Pro or pass) opens the same way, while Convika tells search engines to keep the page out of their results and keeps it out of the gallery. If you prefer Only people with the password, visitors see a password screen first; this is a Pro feature ($12 a month).
4. Copy the live link and paste it into your email
Your page goes live at an address like yourpage.convika.page, which stays the same until you click Unpublish. Free includes 10,000 page views a month across all your pages. Click Copy next to the Live URL and paste that link directly into your email message instead of attaching the .html file. Your teacher, client, or relative can click the link to open the page in their browser on a phone or a computer with no Convika account needed. The Free plan requires no credit card and includes 1 published page, 10,000 page views a month, a small Convika bar at the bottom of each page, and 90 days of page analytics showing total visits by day, country, device, and where visitors came from (you see how many people visited, not who). If you ever spot a mistake after sending the email, you can update the page without changing the link: on the page's screen under New version from a file, drop the updated file, click Upload as a new version, click Open preview, and then click Publish v2 at the same link.
Add a password and check if your page was opened
Once you keep your uploaded file in a free account and click Publish, the confirmation offers Public and Private link. Public is free: anyone with the link (or anyone they forward it to) can open the page without an account, and it may show up in search results and in Convika's gallery. A private link (Pro or pass) opens the same way, while Convika tells search engines to keep the page out of their results and keeps it out of the gallery.
- Password protection (Only people with the password) is a Pro feature ($12 a month).
- Page analytics track visits by day, country, device, and referral source for the last 90 days on the Free plan, so you can see when and how many times the page was viewed.
- If you spot a mistake after emailing the link, go to the page's screen, drop the updated file under New version from a file, click Upload as a new version, click Open preview, and then click Publish v2 at the same link so your recipient sees the fix at the exact same address.
If you are sending a client draft or class project that should stay private, choose Only people with the password so visitors see a password screen before the page loads. To check whether your teacher or client opened the link you emailed, look at your page analytics, which show total visits without tracking individual identities.
Frequently asked questions
Can you email an HTML file?
Yes, you can attach an .html or .htm file in Gmail, Outlook, or iPhone Mail, as neither Gmail nor Outlook blocks those extensions by default. However, work or school mail admins sometimes filter HTML attachments, and recipients often see raw code, missing styles, or disabled scripts when they open the file. If you want the recipient to open a working page directly in their browser, upload the file in the box at the top of this page to get a shareable link instead.
How do I send an HTML file as an email in Outlook?
In a new Outlook message, go to the Message tab and select Attach File, or drag the .html file from your computer into the message if you are using Outlook on the web. Keep in mind that while Outlook does not block .html or .htm files by default, a company Exchange or Microsoft Defender admin can reject them, and the recipient's mail app may open the attachment as raw code or without its scripts. To send a page that opens normally in any browser, drop your file into the box at the top of this page and email the link instead.
Why can't I open an HTML attachment?
Your email app or device determines how an attached .html file opens, so it may show raw code, strip out scripts, or ask you to download the file first. If the page relied on separate image or style.css files on the sender's computer, those did not come along with the attachment, and work or school mail filters sometimes quarantine HTML attachments entirely. If you received the file from someone you trust, you can open it on your device using Convika's free HTML viewer with Run scripts unticked first to look inside.
Is an HTML file attachment a virus?
An HTML file is not a virus by itself, and personal Gmail and Outlook accounts do not put .html or .htm on their default blocked attachment lists. However, attackers have used HTML attachments in phishing emails to evade detection, which is why some work and school mail admins set their filters to quarantine or reject them. If someone sent you an .html file, open it only if you trust the sender, and if you want to check it safely on your device, load it in Convika's free HTML viewer with Run scripts unticked first.
Can you embed HTML in an email?
An "HTML email" whose message body is formatted with HTML is different from sending an .html webpage file as an attachment. Email clients are not full web browsers, so a webpage with scripts or interactive parts will not run inside the email body, and attaching the .html file often leaves the recipient looking at raw code or a broken layout. Instead, drop your .html file (up to 2 MB) into the box at the top of this page and paste the link into your email so the recipient can open the live page in their browser.
Sources
- Gmail Help: Attach files to Gmail messages (checked October 18, 2026)
- Gmail Help: File types blocked in Gmail (checked October 18, 2026)
- Microsoft Support: Blocked attachments in Outlook (checked October 18, 2026)
- Microsoft Learn: Anti-malware protection in EOP (checked October 18, 2026)
- Apple iPhone User Guide: Add email attachments in Mail (checked October 18, 2026)
Next step
How to password protect an HTML page without code, on your own domain
JavaScript passwords sit in the page code. Put an HTML page from ChatGPT or Claude behind a server-checked password on your own domain.
Related articles
- How to share an HTML file as a link that opens on any phoneEmail and Google Drive open HTML files on a phone without scripts. Compare 5 hosts (Netlify Drop, Tiiny Host, GitHub Pages, Convika) and follow 4 steps.
- How to send an HTML page on WhatsApp so it opens in one tapSent through WhatsApp's Document option, an HTML file arrives as a file. Send a link instead so it opens in their phone's browser.
- How do I open an HTML file on an iPhone, and how do I send one that opens?Tap an .html file in the iPhone Files app and you get a preview with no scripts. Open it in Safari with a free viewer, or send a link instead of the file.
- How do I open an HTML file on Android, and how do I send one that opens?Android asks which app opens an .html file. In our emulator test, Chrome ran the page and HTML Viewer didn't. Use Chrome or a free viewer, or get a link.
- Share an HTML file in Teams and have it open as a pageTeams keeps an HTML file in SharePoint or OneDrive, which will not run scripts. Post a link to the published page for colleagues or a class team.
- How to Share an HTML File in Google Drive as a Web PageGoogle Drive shares an HTML file as code or a download, not a web page. See how Drive link sharing works and how to publish your HTML as a live link.