I've been able to hack my way through scripting bridge and apple mail and can now send emails from my cocoa program. Now, I'm trying to send HTML mail and have run into a snag. In short, I have generated an NSString containing the entire HTML code from the open html tag through to the slash-html close tag with all the goodies in between.
However, when I pass that as content through scripting bridge, all I end up with is a email in which I can read the HTML code... I would say it's plain text, but links still show as clickable links, so that's not entirely true.
If I open the code in Safari, the HTML displays correctly.
I thought perhaps it may have to do with the header information in the email message, but if there is a way to set that through scripting bridge, I haven't found a way to do that yet. Again, since links are clickable, I'm thinking they may not be the problem?
If there is a way to set the header information to "Content-Type: text/html; charset=ISO-8859-1" and "MIME-Version: 1.0" and anyone knows how, please enlighten me :)
If not, does anyone have any suggestions? I'm sure that I must be missing something, and I'm hoping it's simple.
* EDIT *
I tried opening my HTML file in Safari and using the FILE>Email Contents which then creates a new email in Apple Mail. This new email is viewable as HTML. Thus, I know it must be possible to do this.
I then send that email to myself, as well as a non-html email.
Inspecting just the header information on both files revealed that the content-type is identical on both of these emails, being listed as:
multipart/alternative; boundary="Apple-Mail=_D0859731-3A0F-459E-9673-DEC0FC6503BF"
Of course, the ID string is different on each email sent...
However, when viewing the raw source, the HTML file does in fact have a second content-type which specifies "text/html" just before the HTML code (which I interpret to mean that the multipart/alternative simply instructs the mail app to look for additional content-type tags...