You can attach an HTML file to an email, and Gmail will let you send it. But the person on the other end often cannot use it properly. The safest way to send an HTML page is as a link, because a link opens in any browser.
Here is what actually happens when you email an HTML file, why it fails, and what to do instead.
Does Gmail block HTML files?
No. At the time of writing, Gmail's help page lists the file types it blocks, and it includes types such as .exe, .js, .bat and .msi. The extensions .html and .htm are not on that list.
So the common advice that "Gmail blocks HTML attachments" is not accurate for Gmail itself. The problem is usually somewhere else.
Why an emailed HTML file still fails
The email can arrive and the file can still be useless. Common reasons:
- Phones do not know what to do with it. On many phones, tapping an
.htmlattachment shows plain text, a blank page, or asks you to pick an app. There is no obvious "open as a web page". - It opens as raw code. Some mail apps show the file as text, so the reader sees angle brackets instead of your design.
- Linked files are missing. If your page uses a separate
style.css, ascript.jsor images in a folder, they are not in the email. The page looks plain or broken. - Security tools get in the way. Company mail systems and antivirus tools can strip, quarantine or warn about HTML attachments, because HTML files can carry scripts. Rules differ from company to company.
- People hesitate. Many people have learned not to open unexpected attachments, and an
.htmlfile from someone they barely know looks suspicious.
For a friend on a laptop who knows to double-click the file, it can work. For clients, teachers or relatives, it often does not.
What to send instead: a link
A link avoids all of these problems. The page opens in the browser, with the styling and scripts working, and the reader does not download anything.
- Make sure your page is one file with the CSS and JavaScript inside it.
- Open DropMyPage and choose Upload file (or Paste HTML if you have the code).
- Tap Create link and copy the link.
- Paste the link into your email, with one line saying what it is.
On the free plan you need no account. Files can be up to 5 MB and the link lasts 7 days. You get a QR code too, which is handy if you also want to put the page on a printed handout.
If you want to double-check the page before sending, use the HTML viewer.
How to word the email
A bare link can look like spam. Add a short message:
Hi Priya, here is the page we talked about: [link]. It opens in your browser, so there is nothing to download. Tell me if anything looks off.
For a work or client email, say what it is and why: "Here is the draft landing page for review."
When an attachment is still the right choice
- The person asked for the file itself, for example to edit or host it.
- They are technical and will open it in a code editor.
- It is a private file that you do not want to put at a web address.
In those cases, send the .html file, and consider zipping it with any linked files in one folder.
Keep it private if you must
Anyone with the link can open the page, so do not send private information this way. On the Pro plan you can set a password on a page. For anything sensitive, share the file through your normal secure channel instead.
Make the link last
Free links last 7 days. If the person might open the email later, or you want the same link to keep working, a permanent link is better. That is a Pro feature on DropMyPage (Monthly $9.99, Yearly $47.99, or Lifetime $59). Features and prices can change, so check the pricing section.
More ways to share a page
- On a phone, see how to open an HTML file on Android or iPhone.
- To send it in chat, read how to send an HTML page on WhatsApp.
- For a full overview, see how to share an HTML file.
FAQ
Can I attach an HTML file to Gmail?
Yes. Gmail does not list .html among the file types it blocks. The recipient may still struggle to open it.
Why does my HTML email attachment show code or a blank page?
Many phones and mail apps do not render HTML attachments. They show it as text or ask which app to use.
Is it safe to open an HTML attachment?
HTML files can contain scripts, so be careful with files from people you do not know. If you are not sure, ask the sender for a link instead.
Is sending a link free?
Yes, for a link that lasts 7 days. A link that stays up needs a permanent link on the Pro plan.