---
title: Mail
description: Sends a mail.
---

Sends a mail.

Presents UI for sending a mail.

## Properties

### bccRecipients

Recipients to set BCC on the mail.

```typescript
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

Body of the mail.

```typescript
body: string
```

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

### ccRecipients

Recipients to set CC on the mail.

```typescript
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

Whether body is HTML.

```typescript
isBodyHTML: bool
```

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

### preferredSendingEmailAddress

Preferred email address to use in the from field.

```typescript
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

Subject of the mail.

```typescript
subject: string
```

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

### toRecipients

Recipients of the mail.

```typescript
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

<span id="-new-mail" class="api-anchor"></span>

### new Mail()

Constructs a mail.

```typescript
new Mail()
```

<span id="-adddataattachment" class="api-anchor"></span>

### addDataAttachment(data, mimeType, filename)

Adds a data attachment to the mail.

```typescript
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

**`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.

<span id="-addfileattachment" class="api-anchor"></span>

### addFileAttachment(filePath)

Adds a file attachment to the mail.

```typescript
addFileAttachment(filePath: string)
```

#### Parameters

**`filePath` `string`**

Path of file to add to the mail.

<span id="-addimageattachment" class="api-anchor"></span>

### addImageAttachment(image)

Adds an image attachment to the mail.

```typescript
addImageAttachment(image: Image)
```

#### Parameters

**`image` `Image`**

Image to add to the mail.

<span id="-send" class="api-anchor"></span>

### send()

Send the mail.

```typescript
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.

#### Return value

**`Promise`**

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