Sending html email using applescript

I am posting here, hoping someone can help. I have successfully used the standard applescript email sender script

do shell script "echo 'email message' | mail -s 'subject of email' 'to email address' -f 'from email address' "

The problem I am now having is… setting the email I am sending as html. Does anyone know how to set the header of the email being sent to: Content-Type: text/html

Have you taken a look at the man page for “mail?”. (Note: this is the unix mail command, not the application “Mail” that we are used to using). In looking it over, I don’t see a provision for sending HTML formatted mail.

That being said, the scripting dictionary for Mail (the Apple-provided GUI mail program, otherwise known as “”) does have a “headers” property, but in my version of Mail (1.2.5 that came with OS X 10.2.8) this is a read-only property and can’t be set during a “make new message” command.

If anyone has info about making HTML messages in mail or Mail, please post.

This is the raw source for a valid HTML message (I use a “multipart/related” message, which works on most email clients):

I never tried *nix “mail”, but I can ensure this works fine with XMail.osax’s “send raw mail” command, and a similar approach will do the trick in Entourage.