Script to send an email using Mail in OS X?
Script to send an email using Mail in OS X?
- Subject: Script to send an email using Mail in OS X?
- From: Rob Miller <email@hidden>
- Date: Mon, 15 Apr 2002 16:18:48 +0100
Hello,
I'm almost a complete novice with Apple Script, so apologies in advance
for the extreme naivety of this question, and many thanks in advance to
anyone who can help.
How can I write a script to get the "Mail" application in OS X to send a
simple email? I've been struggling with this for a few days now but have
got nowhere. Looking in the "Mail" Script Dictionary, there is a
"compose message" object class in the "Mail suite", and a "send" command
in the "Message suite". So my guess is that I have to create a new
instance of the "compose message" class, set its properties
appropriately, and then "send" it. My best effort along these lines is:
tell application "Mail"
set myFirstEmail to (make new compose message)
set subject of myFirstEmail to "Message from emailing script"
set recipient of myFirstEmail to "email@hidden"
set content of myFirstEmail to "Hello Rob!"
send myFirstEmail
end tell
But this doesn't even get past the first nested line. One problem is
that I see from the dictionary that the "make" command has an "at"
parameter, but I haven't any idea what kind of value to give this in the
context of a new mail message (except perhaps a "mailbox" container or
similar?...).
I'm using Mac OS 10.1.3, Script Editor 1.7, Mail 1.1 and Apple Script
1.8 (I think).
Help!
Rob
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.