Filed under HTML
Don’t attach HTML-files in Outlook
Just a short word of warning. I thought I’d mail the min-/max-width template to a colleague at work. So I fired up Outlook, attached the file and sent it. I thought that was it, Outlook couldn’t get something simple like that wrong, could it? Yes it could! Opening the file I found some pretty nasty changes…
- A meta-tag with encoding gets added as the first line of the file (before the doctype). This naturally sends browsers into quirks-mode, effectively destroying most layouts.
- Comments are removed from the file, including Internet Explorers own conditional comments. This makes sure any fixes you have applied gets removed, additionally destroying the layout in IE.
- External stylsheets are instantly removed. You didn’t think you could get away with that, did you?
- Links get
onClick="return (false);"added, making them not work.
Have a look at the mangled Outlook file (and the original file).
I’m sure there’s more Outlook does, but those are the things that I noticed on this file. I’ve tried sending files and opening it with Thunderbird, and that seems to work, so the problem appears when you open the file from within Outlook, both when run as a native application and from the webmail version.
When sending off examples to your clients, do you know what e-mail client they use? Didn’t think so. We better start zipping the files first…
- Emil Stenström
- 28 May, 2007, HTML
Feel free to leave a comment, or subscribe to my feed.
linkback
These people have linked to this article:
- Blog Surfer » What italic means 30 Dec, 2007
To get a link in this list: make sure your blogging software supports trackbacks or pingbacks and simply link to this article like this:
<a href="http://friendlybit.com/html/dont-attach-html-files-in-outlook/">Don’t attach HTML-files in Outlook</a>
You can also trackback by copying this link, and pasting it into a trackback field in your blogging tool.

