
Why is my HTML email all messed up?Dave, I have a problem which I know that many other users have, certainly of Macs, and maybe of other machines as well: Sometimes when I look at an email which has been sent to me which is clearly *supposed* to be rendered in html in my reader, all I actually see is a bunch of html code gobbledygook. As you can imagine, the email is completely unreadable. I have searched and searched for a way to clean this sort of email up so it's readable, but to no avail. I have been told that the problem is that the email sender does not have some sort of code set correctly, and that some mail programs will overlook this (which I guess explains why they keep sending this garbage, maybe not enough people complain), but that some, such as my Mac's, will not. Help! I've seen this crop up on occasion too and it's darn frustrating. From experimentation, it appears that there are two basic ways that an email message indicates that it's written in HTML format, and both revolve around something called the Multipurpose Internet Mail Extensions, MIME.
In the simplest case, the message is sent purely as HTML and there's an additional header added to the message that's Content-type: text/html. Omit that, or have it munged in transit and the nicely designed HTML message ends up being complete gobbledygook, as you see. Some tools at least add a line or two that's hidden when rendered in HTML but visible otherwise that says something like "You need an HTML capable viewer to read this message. If you're seeing this, you need to upgrade, or you can go to
The other, more complex, way to send an HTML message is to actually send multiple versions of the message, one that's just plain text, and one that's a fully detailed HTML message. This is done through what's called a "multipart alternative" message and its headers are a bit more complex. Here's an example:
Basically, you're getting the HTML message, but your mail program just isn't recognizing it as being formatted in one of these two ways (probably the former, I'm guessing).
The fix? If you can edit the message headers (In Microsoft Entourage, you can only edit the body, for example) then just add in the header Content-type: text/html. If not, you could try saving it as a ".html" file then opening it in Safari, Firefox or your favorite browser.
Either way, that's a pain and it'd be easier to communicate with the sender to find out why their mail program isn't creating proper and valid headers.
Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Simpy.
Categorized:
Mac OS X Help
(Article 3910)
Tagged: Previous: How can I hide an HTML form's email address? Next: Can I have a mailto link specify a subject and body? Subscribe!
Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader. Let me add something to this... I had about 500 messages with munged up HTML in one of my folders. I wanted to keep those messages, and I wanted them to be readable. Here's what I did: * Exported them all to a text file (actually an .mbox file). You can do a lot with a text editor. :) Thanks for the tip, it was just what I needed to complete the fix. Posted by: ruminator at June 26, 2005 11:34 PMApple G4 laptop 17", OS 10.4.5, Eudora 6.2.3 Simple solution, Roy: you either have a spell checking system that doesn't know the word "punishment" or you have some sort of macro typing shortcut application installed that is triggering from the word you type. That's VERY weird, however, I agree. ;-) Posted by: Dave Taylor at March 10, 2006 10:46 PMI have a lot to say, but ...
I do have a comment, now that you mention it!
|
![]()
Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.
Help!
Subscribe to
Ask Dave Taylor!
Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.
Articles and Reviews
Auctions and Online Shopping Blogs and RSS Feeds Building Web site traffic Business and Management Cell Phones and Mobile Phones CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above HTML and CSS Mac OS X Help MySpace, Facebook, Twitter and Social Network Help Pay Per Click (PPC) Search Engine Optimization Shell Script Programming Sony PSP, MP3 Players, Etc. The Writing Business Unix and Linux Help Video Game Tips and Help Windows Help
Recent Entries
Join the List!
Book Links
|