# SendMailOptions

> Options used to send an email message.

Options used to send an email message.

**Namespace**: UiPath.Mail.Activities.Api

**Assembly**: UiPath.Mail.Activities.Api (in UiPath.Mail.Activities.Api.dll)

## Properties

| Property | Type | Description |
| --- | --- | --- |
| Attachments | &lt;ListString&gt; | A list of files to send as attachments. |
| Bcc | &lt;ListString&gt; | The hidden recipients of the email message. |
| Body | string | The body of the email message. |
| Cc | &lt;ListString&gt; | The secondary recipients of the email message. |
| ForwardedMessage | MailMessage | The message to forward. |
| IsBodyHtml | bool | Specifies whether the body of the message is written in HTML format. |
| ReplyTo | &lt;ListString&gt; | The email address to use when replying. |
| Subject | string | The subject of the email message. |
| To | &lt;ListString&gt; | The main recipients of the email message. |

## SendMailOptions Methods

These are the methods you can use to configure mail options.

### WithAttachments

Set a list of files to send as attachments.

**Namespace**: UiPath.Mail.Activities.Api

**Assembly**: UiPath.Mail.Activities.Api (in UiPath.Mail.Activities.Api.dll)

#### `WithAttachments(List<string>)`

```csharp
public SendMailOptions WithAttachments(
	List<string> attachments
)
```

**`attachments List<String>`**: The list of files to attach.

#### **Return Value**

**`SendMailOptions`**: Returns an updated instance of SendMailOptions.

### WithBcc

Set the hidden recipients of the email message.

**Namespace**: UiPath.Mail.Activities.Api

**Assembly**: UiPath.Mail.Activities.Api (in UiPath.Mail.Activities.Api.dll)

#### `WithBcc(List<string>)`

```csharp
public SendMailOptions WithBcc(
	List<string> bcc
)
```

**`bcc List<String>`**: The list of hidden recipients.

#### **Return Value**

**`SendMailOptions`**: Returns an updated instance of SendMailOptions.

### WithBody

Set the body of the email message.

**Namespace**: UiPath.Mail.Activities.Api

**Assembly**: UiPath.Mail.Activities.Api (in UiPath.Mail.Activities.Api.dll)

#### `WithBody(string)`

```csharp
public SendMailOptions WithBody(
	string body
)
```

**`body String`**: The body of the email message.

#### **Return Value**

**`SendMailOptions`**: Returns an updated instance of SendMailOptions.

### WithCc

Set the secondary recipients of the email message.

**Namespace**: UiPath.Mail.Activities.Api

**Assembly**: UiPath.Mail.Activities.Api (in UiPath.Mail.Activities.Api.dll)

#### `WithCc(List<string>)`

```csharp
public SendMailOptions WithCc(
	List<string> cc
)
```

**`cc List<String>`**: The list of secondary recipients.

#### **Return Value**

**`SendMailOptions`**: Returns an updated instance of SendMailOptions.

### WithForwardedMessage

Set an email message to forward.

**Namespace**: UiPath.Mail.Activities.Api

**Assembly**: UiPath.Mail.Activities.Api (in UiPath.Mail.Activities.Api.dll)

#### `WithForwardedMessage(MailMessage)`

```csharp
public SendMailOptions WithForwardedMessage(
	MailMessage forwardedMessage
)
```

**`forwardedMessage MailMessage`**: The email message to forward.

#### **Return Value**

**`SendMailOptions`**: Returns an updated instance of SendMailOptions.

### WithHtmlBody

Set whether the body of the message is written in HTML format.

**Namespace**: UiPath.Mail.Activities.Api

**Assembly**: UiPath.Mail.Activities.Api (in UiPath.Mail.Activities.Api.dll)

#### `WithHtmlBody(bool)`

```csharp
public SendMailOptions WithHtmlBody(
	bool isBodyHtml
)
```

**isBodyHtml [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)**: Whether the body of the message is written in HTML format.

#### **Return Value**

**`SendMailOptions`**: Returns an updated instance of SendMailOptions.

### WithReplyTo

Set the email addresses to use when replying.

**Namespace**: UiPath.Mail.Activities.Api

**Assembly**: UiPath.Mail.Activities.Api (in UiPath.Mail.Activities.Api.dll)

#### `WithReplyTo(List<string>)`

```csharp
public SendMailOptions WithReplyTo(
	List<string> replyTo
)
```

**replyTo [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)&lt;[String](https://learn.microsoft.com/dotnet/api/system.string)&gt;**: The list of email addresses to reply to.

#### **Return Value**

**`SendMailOptions`**: Returns an updated instance of SendMailOptions.

### WithSubject

Set the subject of the email message.

**Namespace**: UiPath.Mail.Activities.Api

**Assembly**: UiPath.Mail.Activities.Api (in UiPath.Mail.Activities.Api.dll)

#### `WithSubject(string)`

```csharp
public SendMailOptions WithSubject(
	string subject
)
```

**`subject String`**: The subject of the email message.

#### **Return Value**

**`SendMailOptions`**: Returns an updated instance of SendMailOptions.

### WithTo

Set the main recipients of the email message.

**Namespace**: UiPath.Mail.Activities.Api

**Assembly**: UiPath.Mail.Activities.Api (in UiPath.Mail.Activities.Api.dll)

#### `WithTo(List<string>)`

```csharp
public SendMailOptions WithTo(
	List<string> to
)
```

**`to List<String>;`**: The list of main recipients.

#### **Return Value**

**`SendMailOptions`**: Returns an updated instance of SendMailOptions.
