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


let mail = Mail.create();
mail.toRecipients = [""];
mail.subject = "My test message";
mail.body = "Body text";

let success = mail.send();
if (!success) {


  • Mail


  • Create new instance.

    Returns Mail


bccRecipients: string[]

Array of email addresses to use as BCC: recipients.

body: string

Body text of the mail message. Can be plain text or HTML if the isBodyHTML property is set to true.

ccRecipients: string[]

Array of email addresses to use as CC: recipients.

isBodyHTML: boolean

whether to treat the body string and plain text or HTML. When set to true, the body property should be set to full valid HTML.

isSent: boolean

Indicates if the message object has already been sent.

replyToRecipients: string[]

Array of email addresses to use in Reply-To: header. Used only when sendInBackground is true.

sendInBackground: boolean

If true, the mail will be sent in the background using a web service rather than via - but will come from Defaults to false.

status: mailStatus

One of the following values:

  • created: Initial value before send() has been called.
  • sent: The message was sent successfully.
  • savedAsDraft: On iOS, the user exited the window saving as draft, but not sending.
  • mailUnavailable: On iOS, services were not available.
  • userCancelled: The user cancelled the window without sending.
  • invalid: Mail object is invalid. Common cause if of this is sendInBackground being true, but no recipient configured.
  • serviceError: Background mail service returned an error.
  • unknownError: An unknown error occurred.
subject: string

Subject line

toRecipients: string[]

Array of email addresses to use as To: recipients.


  • Send the mail message. This will open the sending window. Returns true if the message was sent successfully or false if not - if, for example, the user cancelled the mail window.

    Returns boolean

  • Create Mail object

    Returns Mail

Generated using TypeDoc