Drafts Script Reference

Mail

The Mail object can be used to create and send mail messages, similar to those created by a “Mail” action step.

Instance Properties

Functions

Class Functions

Examples

var mail = Mail.create();
mail.toRecipients = ["joe@sample.com"];
mail.subject = "My test message";
mail.body = "Body text";

var success = mail.send();
if (!success) {
  console.log(mail.status);
  context.fail();
}