Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: exp_jstalk
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (14 sloc) 0.73 kB
var mail = SBApplication.application_("Mail");
var to = "someone@somewhere.com";
var from = "someone@somewhere.com";
var subject = "This is the subject.";
var content = "This is the message content.\n\nIsn't it great?";
var emailMessageProps = {subject:subject, content:content};
var emailMessage = mail.classForScriptingClass_("outgoing message").alloc().initWithProperties_(emailMessageProps);
mail.outgoingMessages().addObject_(emailMessage);
emailMessage.sender = from;
emailMessage.visible = true;
theRecipientProps = {address:from};
theRecipient = mail.classForScriptingClass_("to recipient").alloc().initWithProperties_(theRecipientProps);
emailMessage.toRecipients().addObject_(theRecipient);
emailMessage.send();
Jump to Line
Something went wrong with that request. Please try again.