Send e-mail via applescript

Is it possible to send an e-mail via AppleScript? Without starting or using another e-mail client? Perhaps using ‘sendmail’? Or something?


You could try the Xmail osax.

Best wishes

John M

BTW, I’m also going to be posting this script on my website, so that may create a problem for people wanting to use it.

Perhaps you could supply it as an application bundle containing the osax?

I’m not too sure whether there are any problems using the UNIX mail command:

set messTo to ""
set messFrom to ""
set messSub to "Message subject"
set messBody to "test" & return & "this?"

do shell script "echo " & (quoted form of messBody) & " | mail -s " & (quoted form of messSub) & " " & messTo & " -f " & messFrom

man pages for mail

It might help if you could give some more details about your project.

John M

Well, it is open-source, but I’m not sure if that’s legal.

I hope it’s legal, as I do it in one of my apps :smiley:

I use to include the docs of the bundled applications, as well as mentioning clearly to the authors of third-parties in the documentation. Most probably this isn’t quite the rigth behaviour, but I’m sure nobody will blame you, unless you use the bundled software as part of a new commercial OS :lol:

A nice tool is also sendEmail, a powerful and easy-to-use Perl script: