Skip to content

Mail

Sends a mail.

Presents UI for sending a mail.

Recipients to set BCC on the mail.

bccRecipients: [string]

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.

Body of the mail.

body: string

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

Recipients to set CC on the mail.

ccRecipients: [string]

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.

Whether body is HTML.

isBodyHTML: bool

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

Preferred email address to use in the from field.

preferredSendingEmailAddress: string

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.

Subject of the mail.

subject: string

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

Recipients of the mail.

toRecipients: [string]

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.

Constructs a mail.

new Mail()

addDataAttachment(data, mimeType, filename)

Section titled “addDataAttachment(data, mimeType, filename)”

Adds a data attachment to the mail.

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

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.

data Data

Data representation of file to add to the mail.

mimeType string

MIME type of file represented by the data.

filename string

Name of the file represented by the data.

Adds a file attachment to the mail.

addFileAttachment(filePath: string)

filePath string

Path of file to add to the mail.

Adds an image attachment to the mail.

addImageAttachment(image: Image)

image Image

Image to add to the mail.

Send the mail.

send(): Promise

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.

Promise

Promise that is fulfilled when the mail have been sent or saved.