tags:

views:

232

answers:

3

Is there any way I can send an email, like any frameworks or something. I've tried some (pantomime, mailcore) but I can't get them to work. So if you know of any frameworks/other methods, or if you know of a good open source example using either pantomime or mailcore I would greatly appreciate it

+1  A: 

EDMessage: http://www.mulle-kybernetik.com/software/EDFrameworks/

Dave DeLong
A: 

If you're sending messages to the user's contacts, you might want to follow Apple's example (as seen in the iPhone and iWork 09) and send them through Mail.app.

igul222
that's what I do now, but the users of my app hate it
Matt S.
+1  A: 

Growl's MailMe display does this. We used to use the Message framework, but its public API went away in the 64-bit transition, so we had to find something else to make it 64-bit clean.

For awhile (prior to starting the beta cycle), we were using Scripting Bridge to tell Mail to send the message. This worked, according to the patch author, but it's a very strong dependency on Mail, and I'm sure our users who don't use Mail wouldn't like it.

I looked at Pantomime, EDMessage, and SKPSMTPMessage. Every single one either was way too complex for our needs (i.e., it was a framework for implementing a complete mail client), didn't work on Mac OS X, or both.

What I ended up doing was writing a Python script to send the message using Python's smtplib module. Here's the script, under a BSD license. We use NSTask to run the python interpreter and give the script to it, and NSPipe to give the password and message body to the script. You can run the script from the command line with the --help option to see how to run it.

Peter Hosey
cool, could you give me an example using that script? I've never used NSPipe before
Matt S.
See `displayNotification:` in GrowlMailMeDisplay: http://code.google.com/p/growl/source/browse/Plugins/Displays/MailMe/GrowlMailMeDisplay.m Note that we're getting the SMTP settings from Mail's Preferences, but you should probably have your own SMTP-settings UI (as we will, as soon as we don't have other things on our plate).
Peter Hosey