Sends a mail.
Presents UI for sending a mail.
Properties
Section titled “Properties”bccRecipients
Section titled “bccRecipients”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: stringBody of the mail to send. You will have a chance to modify this before the mail is sent.
ccRecipients
Section titled “ccRecipients”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.
isBodyHTML
Section titled “isBodyHTML”Whether body is HTML.
isBodyHTML: boolSet to true if the body of the mail is HTML. Defaults to false.
preferredSendingEmailAddress
Section titled “preferredSendingEmailAddress”Preferred email address to use in the from field.
preferredSendingEmailAddress: stringSets 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
Section titled “subject”Subject of the mail.
subject: stringSubject of the mail to send. You will have a chance to modify this before the mail is sent.
toRecipients
Section titled “toRecipients”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.
Methods
Section titled “Methods”
new Mail()
Section titled “new Mail()”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.
Parameters
Section titled “Parameters”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.
addFileAttachment(filePath)
Section titled “addFileAttachment(filePath)”Adds a file attachment to the mail.
addFileAttachment(filePath: string)Parameters
Section titled “Parameters”filePath string
Path of file to add to the mail.
addImageAttachment(image)
Section titled “addImageAttachment(image)”Adds an image attachment to the mail.
addImageAttachment(image: Image)Parameters
Section titled “Parameters”image Image
Image to add to the mail.
send()
Section titled “send()”Send the mail.
send(): PromisePresents a screen from which the mail can be sent. The mail will not be sent until you have confirmed it from the presented screen.
Return value
Section titled “Return value”Promise
Promise that is fulfilled when the mail have been sent or saved.