Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Send HTML with embedded images emails from Mail Apps
Sending HTML emails is bad, almost everyone agree on this, but in some contexts it is absolutely necessary and you do not really have a choice. Unfortunately it is the only way that I am aware of to send embedded images (i.e. screenshots, typeset mathematical formulas, etc.) to a recipient using Outlook.

Being based on WebKit, Mail is capable of editing HTML, but this option is not available by default. Officially it is only possible to compose messages using plain or rich text. The interesting thing is that Mail allows you to edit an HTML message, once you managed to put some HTML in the content. There are many ways to do that, here are three examples:
  • Directly from Safari (File » Mail Contents of This Page)
  • Copying and pasting some HTML content (from whichever Web Browser)
  • From the Mail bundle in TextMate
These are all valid methods to force Mail to use HTML for a message, but they are not very handy. The idea to automatize this process is very simple: use an HTML signature. If you use an HTML signature, Mail will automatically switch to HTML mode; you are free to add embedded contents (i.e. images) in the message, which will be correctly encoded and displayed in other email clients. Create an HTML signature is simple: copy and paste something from a web page in the signature box and modify it.

If you want your messages to display correctly everywhere, some care is needed in choosing image formats. If you simply drag and drop an image from another application, it will be sent as a TIFF, and Outlook will not be able to display it (unless you click on Reply; apparently the image viewer in the preview pane is not the same as the one in the Compose window). You should also avoid embedding PDF images.

On the other hand, if you drag or copy/paste a jpeg file in the message, it will be correctly encoded as image/jpeg. Last thing to be aware of: your message should begin and end with text (i.e. you should not embed an image or a file at the beginning or end of file).

If there are problems with the text encoding, the best is to use UTF-8. Here is an interesting post explaining how to do that: in brief, open the Terminal and issue the following:
defaults write com.apple.mail NSPreferredMailCharset "UTF-8"
Warning: The message will be sent in HTML only. This means that it will not be readable by a recipient using a text-only client.
    •    
  • Currently 3.88 / 5
  You rated: 3 / 5 (8 votes cast)
 
[104,196 views]  

Send HTML with embedded images emails from Mail | 15 comments | Create New Account
Click here to return to the 'Send HTML with embedded images emails from Mail' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Send HTML with embedded images emails from Mail
Authored by: rflorence on Apr 10, '07 08:22:32AM

If you enter a word into an outgoing message in Mail.app, change the word to italics or bold, and answer 'yes' to the popup asking if you want to change to rich mode, you can then edit the buffer as HTML. (You can change the word back from italics or bold.) The outgoing message will include both html and plain text versions, and should be readable on most mailers.



[ Reply to This | # ]
Send HTML with embedded images emails from Mail
Authored by: amigaman on Apr 10, '07 09:50:37AM
Why is sending HTML email bad? That's like saying driving a car with power steering is bad. It's the year 2007 man, get with technology!

[ Reply to This | # ]
Send HTML with embedded images emails from Mail
Authored by: jiclark on Apr 10, '07 10:34:09AM
Why is HTML email bad? Read this:

http://www.efn.no/html-bad.html#part2

[ Reply to This | # ]
Send HTML with embedded images emails from Mail
Authored by: tatilsever on Apr 10, '07 11:10:08AM

That article is from 2002. :)



[ Reply to This | # ]
HTML is still for web pages, not email... even in 2007
Authored by: tersono on Apr 10, '07 12:04:51PM

That article may be from 2002, but the points made are as valid today as they were then.

Bear in mind that there's a lot of mail clients out there that still don't display HTML - and even more folks who disable HTML in their client of choice.

It's also worth remembering that most spam filtering systems score HTML mail (especially if it has embedded images) rather higher than plain text only.

Any personal preferences aside, if you want to be sure that your recipient sees your message, plain text is the sensible choice. Plain text with the HTML attached (as many mail clients deliver) is a reasonable compromise if you HAVE to use HTML.



[ Reply to This | # ]
Send HTML with embedded images emails from Mail
Authored by: banboobog on Apr 11, '07 09:37:00PM

Am I wrong, or hasn't the Leopard team, "Billed as the most advanced operating system every", spent a great deal of time and effort making its mail app, at least as HTML friendly as Netscape was many, many years ago when most of us used it for both our browser and a HTML mail app.



[ Reply to This | # ]
Send HTML with embedded images emails from Mail
Authored by: JaxMyers on Apr 10, '07 05:23:57PM

I didn't know sending HTML is bad. I usually use my flickr photo-stream as a signature for people I know, and I use an HTML clickable signature with my personal webpage for most other people.

Would you recommend writing my webpage address out rather than imbedding it in a <A HREF> tag? If so, why?



[ Reply to This | # ]
Send HTML with embedded images emails from Mail
Authored by: frgough on Apr 10, '07 06:03:24PM

It isn't; ignore the people who tell you otherwise. The spittle flying from their mouths as they condemn you for sending HTML email tell you what kind of people they are.



[ Reply to This | # ]
Send HTML with embedded images emails from Mail
Authored by: sjmills on Apr 10, '07 08:43:39PM

It's only annoying when people use tiny fonts or blue text, crap like that. And when people put images in the .sigs. Stop that. I don't need to see the same image every time and it's a waste of bandwidth, disk space, and cpu.



[ Reply to This | # ]
Send HTML with embedded images emails from Mail
Authored by: jiclark on Apr 10, '07 09:59:34PM

C'mon now, none of the comments above are anywhere near as vitriolic as yours. As with most things, this is a matter of personal preference. A question was asked about why many people think html email is less than ideal. Several of us attempted to explain ourselves, calmly and without resorting to nastiness.

Please, how much harder is it to respectfully respond to a comment with which you simply disagree?



[ Reply to This | # ]
Send HTML with embedded images emails from Mail
Authored by: Elander on Apr 11, '07 05:50:51AM

First: this is not as easy as it seems.
This hint will get you into trouble if you use any characters outside the 7-bit ASCII set. To make HTML-mail functional, you have to make sure that all the parts of your mail (including the plain text version that is always included) are using UTF-8. You can't use any other setting, since file names of your attachments are all UTF-8 by default; that's what the file system in Mac OS X is using. Unfortunately this messes the message up in Hotmail, since Hotmail only supports sending in UTF-8, not receiving. The only way I know of that works, in setting the character encodings in all the parts, is by manually editing Mail.plist.

Second: HTML-mail is bad, and getting worse. The new version of Outlook will be using the same rendering as Word, instead of the Internet Explorer renderer it currently uses. This means that a lot of formatting options will go away (CSS for example). Lotus Notes can't handle HTML, Hotmail and GMail sucks at it and Eudora still doesn't support CSS.

---

/elander



[ Reply to This | # ]
Send HTML with embedded images emails from Mail
Authored by: bronskrat on Apr 11, '07 06:14:22AM

This does not work from Firefox, btw. Safari does work though.



[ Reply to This | # ]
Send HTML with embedded images emails from Mail
Authored by: gshenaut on Apr 11, '07 09:27:00AM

Interesting. Up until reading this hint and the comments, I had always just assumed that people who sent me html mail either were spammers or were people who were unable for some reason to send mail in plain text. Now I know that some people do it on purpose and even prefer it.

Live and learn, I always say.

Greg Shenaut



[ Reply to This | # ]
Send HTML with embedded images emails from Mail
Authored by: wsdr on Apr 16, '07 12:22:28PM

Hey Rob, how about a poll about what users prefer: HTML vs. plain/text?

I send mail using plain/text, and when someone sends me a formatted email, I always flip to the plain/text version if available. Why? I like my text small, so my mail preferences are set to use sizes smaller than the default. Much of the time when I receive html formatted email, this causes the text to be rendered even smaller-- too small to be readable-- but in plain/text mode I can easily read it. And if that is not an option, usually it is junk mail anyway, or I don't care to read it.



Also, related to this, is the wastefulness of sending of attachments via email. Because all email is ultimately transmitted as text, any embedded images or attachments must be encoded in order to be sent. This process generally increases the size of the attachment by a factor of 1/3. (1Mb = 1.3Mb or so when sent via email, sometimes more; I'm sure someone can give a more specific explanation. And, for those more technical, please understand I am totally ignoring all of the other overhead involved in transmitting data in general over an internet connection, and the differences between TCP or UDP, etc., etc.)

Let's use the example of a 1Mb file. When you email an attachment, it travels from your computer out to the SMTP server of your ISP (or your own server). So, 1.3Mb of bandwidth gets consumed between you and your (ISPs) server. The email then gets transmitted from your (ISPs) server to the destination server-- another 1.3Mb of bandwidth gets consumed. (I will ignore the case of multiple SMTP servers, but there is often more than one server involved at larger ISPs, say, Comcast.) The recipient now checks his mail and downloads your message-- another 1.3Mb of bandwidth consumed.

So, a 1Mb file consumes about 4Mb in being transmitted via email. Can this be improved upon? Sure, send it via FTP, or one of the many web-based file-sending services such as yousendit.com or mediafire.com. In each of those cases the total bandwidth consumption will be about 1/2 of that of email. And if you use iChat to send it directly, the total bandwidth consumption is about 1/4 as it would be sending via email!



[ Reply to This | # ]
Send HTML with embedded images emails from Mail
Authored by: wsdr on Apr 20, '07 06:54:40AM