Thursday, January 13, 2011

Fun with HTML mail and word wrap

One would think that standard email is a pretty much solved problem these days. Some recent events showed me otherwise:
  1. take Thunderbird and set it to HTML mail
  2. receive a regular text mail
  3. forward said email as HTML mail
  4. receive that forwarded mail with Outlook
  5. try to print it
What happens is this: Thunderbird sticks the original mail into a <pre> tag and when Outlook then receives it, it interprets it properly as HTML, except of course that it follows the spec a little to closely. <pre> tags don't word wrap in your browser and Outlook replicates that behavior exactly, thus if that original mail contained a few long lines, Outlook will display them as a single long line without word wrap, leading to a huge horizontal scroll bar when viewing and a plain cut-off of the text when trying to print it.

1 comment:

Unknown said...

I think the problem is with Thunderbird simply wrapping it up in <pre>. Outlook is behaving correctly. It really should be wrapped in "<pre style='white-space: pre-wrap;'>".

I'm not sure if Outlook supports that, but that's another issue.