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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to