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…

  1. 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.
  2. 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.
  3. External stylsheets are instantly removed. You didn’t think you could get away with that, did you?
  4. 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…

Feel free to leave a comment, or subscribe to my feed.

related

List some related articles:

You might want to browse all articles.

linkback

These people have linked to this article:

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.

about

Author: Emil Stenström

Emil Stenström blogs about web development. Posts are bi-weekly.

To the about section

comments

What do you think about this article? I’d love to hear your view!

Scroll to comment box.

  1. Georges Jentgen 29 May

    01

    …then Outlook changes the fileype to an executable and on the client side it gets blocked :)

    There are a lot of things that make me hate Outlook and switch to Thunderbird.

  2. Marcus Ahnve 29 May

    02

    Or you could just stop using Outlook.

    Also, Outlook has been known to peek inside zip files. Using a more obscure compression like tar.bz2 might do the trick though.

  3. Emil Stenström 29 May

    03

    @Marcus Ahnve: It happens when someone opens a file in Outlook, so what program I use does not matter much :(

  4. Bobby Ong Wannelind 29 May

    04

    Great work MS Outlook!

  5. Ski 29 May

    05

    I often create a temporary Yahoo Group and upload files there. I then invite people who are interested in getting the file to download it from there. Gives you some level of anonymity, some security, and often works through most fire walls.

    Regards

  6. J. Waatti 2 Jun

    06

    I noticed the same thing with Outlook a while ago at work. I was supposed to solve a font problem on a HTML file and Outlook made my work a lot harder by messing the file up. I’m glad I was able to notice the changes that Outlook made to the file, otherwise I might have been stuck with the problem for a long time.

    I’m also glad I don’t have to use MS products at home.

If you want to you can follow the disussion through a comment feed.

add comment

This is the place where you get to say your opinion about this article, use it well. Formating with HTML is allowed. A red asterisk means that the following field is required.

Comment Form




Comment Form