# ImapConnectionOptions

> Options used to connect to the IMAP mail server.

Options used to connect to the IMAP mail server.

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

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

**Inheritance**: [System.Object](https://learn.microsoft.com/dotnet/api/system.object) > [MailConnectionOptions](https://docs.uipath.com/activities/other/latest/productivity/uipath-mail-activities-api-mailconnectionoptions#mailconnectionoptions) > ImapConnectionOptions

## Constructor

Initializes a new instance of the ImapConnectionOptions class.

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

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

### `ImapConnectionOptions (string, int)`

```
public ImapConnectionOptions(
	string server,
	int port
)
```

**`server String`** : The email server host to use.

**`port Int32`** : The port used to connect.

## Properties

| Property | Type | Description |
| --- | --- | --- |
| ClientName | string | The Name property of the IMAP client implementation. |
| ClientVersion | string | The Version property of the IMAP client implementation. |
| Email | string | Inherited from MailConnectionOptions. |
| IgnoreCRL | bool | Inherited from MailConnectionOptions. |
| Password | string | Inherited from MailConnectionOptions. |
| Port | int | Inherited from MailConnectionOptions. |
| SecureConnection | SecureSocketEncryption | Inherited from MailConnectionOptions. |
| Server | string | Inherited from MailConnectionOptions. |
| UseOAuth | bool | Inherited from MailConnectionOptions. |

## Methods

These are the methods you can use to configure IMAP connection options.

### WithClient

Set the ClientName and ClientVersion properties of the IMAP client implementation.

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

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

#### `WithClient(string, string)`

```
public ImapConnectionOptions WithClient(
	string name,
	string version
)
```

**`name String`** : The Name property of the IMAP client implementation.

**`version String`** : The Version property of the IMAP client implementation.

#### **Return Value**

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

### WithClientName

Set the ClientName property of the IMAP client implementation.

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

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

#### `WithClientName(string)`

```
public ImapConnectionOptions WithClientName(
	string name
)
```

**`name String`** : The Name property of the IMAP client implementation.

#### **Return Value**

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

### WithClientVersion

Set the ClientVersion property of the IMAP client implementation.

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

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

#### `WithClientVersion(string)`

```
public ImapConnectionOptions WithClientVersion(
	string version
)
```

**`version String`** : The Version property of the IMAP client implementation.

#### **Return Value**

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