• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: preparing HTML email content for Mail.app like safari does
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: preparing HTML email content for Mail.app like safari does


  • Subject: Re: preparing HTML email content for Mail.app like safari does
  • From: has <email@hidden>
  • Date: Sat, 7 Mar 2009 21:59:38 +0000

Ferhat Ayaz wrote:

I like it how safari prepares email contents with cmd-i. I would like
to know how to do this programatically in cocoa. Is this possible?
I want to send local html files with all linked images as html email.


Safari uses an undocumented Apple event API (mail/mlpg) in Mail. I guess you could sniff some event traffic using AEDebug and try to reverse engineer the data format used, then construct your own copycat events. Given that it's a private API though you've no guarantee that the format won't change in future releases.

Creating a plain text message with attachments via the public Apple event ('AppleScript') API is pretty straightforward - e.g. there's an example Xcode project in the objc-appscript repository that does this. You can even apply rudimentary styles, one run at a time, if you're patient enough. (Unfortunately, there's no standard for passing styled text/RTF/HTML/etc. directly between processes; a longstanding deficiency.)

I'm not sure if you can create an HTML email or not via Mail's public scripting interface - best thing would be to ask on the AppleScript users mailing list as that's where you'll find most experienced Mail scripters.

http://lists.apple.com/mailman/listinfo/applescript-users

HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Trying to understand the cause of a "message sent to deallocated instance" error
  • Next by Date: Re: Trying to understand the cause of a "message sent to deallocated instance" error
  • Previous by thread: preparing HTML email content for Mail.app like safari does
  • Next by thread: Need to use Quartz... I think?
  • Index(es):
    • Date
    • Thread