Skip to content

Mail

Sends a mail.

Presents UI for sending a mail.

toRecipients

Recipients of the mail.

Array of recipients to send the mail to. Elements in the array should be e-mail addresses. You will have a chance to modify this before the mail is sent.

toRecipients: [string]

ccRecipients

Recipients to set CC on the mail.

Array of recipients to set as CC on the mail. Elements in the array should be e-mail addresses. You will have a chance to modify this before the mail is sent.

ccRecipients: [string]

bccRecipients

Recipients to set BCC on the mail.

Array of recipients to set as BCC on the mail. Elements in the array should be e-mail addresses. You will have a chance to modify this before the mail is sent.

bccRecipients: [string]

subject

Subject of the mail.

Subject of the mail to send.\You will have a chance to modify this before the mail is sent.

subject: string

body

Body of the mail.

Body of the mail to send.\You will have a chance to modify this before the mail is sent.

body: string

isBodyHTML

Whether body is HTML.

Set to true if the body of the mail is HTML. Defaults to false.

isBodyHTML: bool

preferredSendingEmailAddress

Preferred email address to use in the from field.

Sets the preferred email addressed to use when sending the mail. If no account with the preferred email address is set up, the default email address is used.

preferredSendingEmailAddress: string

-new Mail

Constructs a mail.

Constructs a mail to be sent either as a text message or an iMessage.

new Mail()

-send

Send the mail.

Presents a screen from which the mail can be sent. The mail will not be sent until you have confirmed it from the presented screen.

send(): Promise

-addImageAttachment

Adds an image attachment to the mail.

addImageAttachment(image: Image)

-addFileAttachment

Adds a file attachment to the mail.

addFileAttachment(filePath: string)

-addDataAttachment

Adds a data attachment to the mail.

When adding a data attachment to the mail, you are responsible for providing a valid MIME type and filename. It is advised to use addImageAttachment and addFileAttachment whenever possible.

addDataAttachment(data: Data, mimeType: string, filename: string)