> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SuperOffice.WebApi.Agents.IEMailAgent

# \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent">\</a> Interface IEMailAgent

Namespace: [SuperOffice.WebApi.Agents](SuperOffice.WebApi.Agents.md)\
Assembly: SuperOffice.WebApi.dll

Email connection, reading, sending
\<p>\</p>
\<b>Online Restricted:\</b> This agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
public interface IEMailAgent : IAgentBase, IDisposable
```

#### Implements

[IAgentBase](SuperOffice.WebApi.Agents.IAgentBase.md),
[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

## Methods

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_AuthenticateAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfoExtended\_SuperOffice\_WebApi\_RequestOptions\_">\</a> AuthenticateAsync(EMailConnectionInfoExtended, RequestOptions)

\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<bool> AuthenticateAsync(EMailConnectionInfoExtended connectionInfoExtended, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfoExtended` [EMailConnectionInfoExtended](SuperOffice.WebApi.Data.EMailConnectionInfoExtended.md)

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_AuthenticateIncomingAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_SuperOffice\_WebApi\_RequestOptions\_">\</a> AuthenticateIncomingAsync(EMailConnectionInfo, RequestOptions)

Authenticate against a mail-server to retrieve e-mails from
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<bool> AuthenticateIncomingAsync(EMailConnectionInfo connectionInfo, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

True if authentication was succcesfull

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_AuthenticateOutgoingAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_SuperOffice\_WebApi\_RequestOptions\_">\</a> AuthenticateOutgoingAsync(EMailConnectionInfo, RequestOptions)

Authenticate against a mail server to send items with
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<bool> AuthenticateOutgoingAsync(EMailConnectionInfo connectionInfo, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

True if authentication was succcesfull

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CacheFolderListAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CacheFolderListAsync(RequestOptions)

Fetch list of folders from email server for the current account, and cache in DB
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailFolder[]> CacheFolderListAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailFolder](SuperOffice.WebApi.Data.EMailFolder.md)\[]\&gt;

List of folders from mail server

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateDefaultEMailAccountAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultEMailAccountAsync(RequestOptions)

Set default values into a new EMailAccount.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<EMailAccount> CreateDefaultEMailAccountAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAccount](SuperOffice.WebApi.Data.EMailAccount.md)\&gt;

A blank EMailAccount

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateDefaultEMailAddressAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultEMailAddressAsync(RequestOptions)

Set default values into a new EMailAddress.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<EMailAddress> CreateDefaultEMailAddressAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAddress](SuperOffice.WebApi.Data.EMailAddress.md)\&gt;

A blank EMailAddress

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateDefaultEMailAppointmentAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultEMailAppointmentAsync(RequestOptions)

Set default values into a new EMailAppointment.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<EMailAppointment> CreateDefaultEMailAppointmentAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAppointment](SuperOffice.WebApi.Data.EMailAppointment.md)\&gt;

A blank EMailAppointment

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateDefaultEMailAttachmentAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultEMailAttachmentAsync(RequestOptions)

Set default values into a new EMailAttachment.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<EMailAttachment> CreateDefaultEMailAttachmentAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAttachment](SuperOffice.WebApi.Data.EMailAttachment.md)\&gt;

A blank EMailAttachment

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateDefaultEMailConnectionInfoAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultEMailConnectionInfoAsync(RequestOptions)

Set default values into a new EMailConnectionInfo.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<EMailConnectionInfo> CreateDefaultEMailConnectionInfoAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)\&gt;

A blank EMailConnectionInfo

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateDefaultEMailConnectionInfoExtendedAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultEMailConnectionInfoExtendedAsync(RequestOptions)

Set default values into a new EMailConnectionInfoExtended.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<EMailConnectionInfoExtended> CreateDefaultEMailConnectionInfoExtendedAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailConnectionInfoExtended](SuperOffice.WebApi.Data.EMailConnectionInfoExtended.md)\&gt;

A blank EMailConnectionInfoExtended

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateDefaultEMailCustomHeaderAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultEMailCustomHeaderAsync(RequestOptions)

Set default values into a new EMailCustomHeader.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<EMailCustomHeader> CreateDefaultEMailCustomHeaderAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailCustomHeader](SuperOffice.WebApi.Data.EMailCustomHeader.md)\&gt;

A blank EMailCustomHeader

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateDefaultEMailEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultEMailEntityAsync(RequestOptions)

Set default values into a new EMailEntity.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<EMailEntity> CreateDefaultEMailEntityAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

A blank EMailEntity

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateDefaultEMailEnvelopeAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultEMailEnvelopeAsync(RequestOptions)

Set default values into a new EMailEnvelope.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<EMailEnvelope> CreateDefaultEMailEnvelopeAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEnvelope](SuperOffice.WebApi.Data.EMailEnvelope.md)\&gt;

A blank EMailEnvelope

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateDefaultEMailFolderAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultEMailFolderAsync(RequestOptions)

Set default values into a new EMailFolder.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<EMailFolder> CreateDefaultEMailFolderAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailFolder](SuperOffice.WebApi.Data.EMailFolder.md)\&gt;

A blank EMailFolder

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateDefaultEMailSOInfoAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultEMailSOInfoAsync(RequestOptions)

Set default values into a new EMailSOInfo.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<EMailSOInfo> CreateDefaultEMailSOInfoAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailSOInfo](SuperOffice.WebApi.Data.EMailSOInfo.md)\&gt;

A blank EMailSOInfo

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateEMailFromDocumentEntityAsync\_SuperOffice\_WebApi\_Data\_DocumentEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateEMailFromDocumentEntityAsync(DocumentEntity, RequestOptions)

Get an e-mail based on the provided DocumentEntity
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> CreateEMailFromDocumentEntityAsync(DocumentEntity documentEntity, RequestOptions requestOptions = null)
```

#### Parameters

`documentEntity` [DocumentEntity](SuperOffice.WebApi.Data.DocumentEntity.md)

DocumentEntity data

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The e-mail

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateEMailFromMimeMessageAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateEMailFromMimeMessageAsync(string, RequestOptions)

Get an e-mail based on the provided MIME-message
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> CreateEMailFromMimeMessageAsync(string mimeMessage, RequestOptions requestOptions = null)
```

#### Parameters

`mimeMessage` [string](https://learn.microsoft.com/dotnet/api/system.string)

string representing a MIME-formatted message

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The e-mail

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateFolderAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateFolderAsync(EMailConnectionInfo, RequestOptions)

Create a new folder on the server
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task CreateFolderAsync(EMailConnectionInfo connectionInfo, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateForwardEmailAsync\_SuperOffice\_WebApi\_Data\_EMailEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateForwardEmailAsync(EMailEntity, RequestOptions)

Create forward email
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> CreateForwardEmailAsync(EMailEntity email, RequestOptions requestOptions = null)
```

#### Parameters

`email` [EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)

The e-mail to forward

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The new forward email entity

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateInlineHtmlHeaderAsync\_SuperOffice\_WebApi\_Data\_EMailEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateInlineHtmlHeaderAsync(EMailEntity, RequestOptions)

Create Outlook style HTML header to use in for instance reply entities and when printing
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<string> CreateInlineHtmlHeaderAsync(EMailEntity email, RequestOptions requestOptions = null)
```

#### Parameters

`email` [EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)

The e-mail to generate header based on

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

The generated HTML header

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateNewPhysicalDocumentFromEmailAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateNewPhysicalDocumentFromEmailAsync(int, int, RequestOptions)

Save the Email from the server as a document file connected to existing document
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<DocumentEntity> CreateNewPhysicalDocumentFromEmailAsync(int documentId, int emailItemId, RequestOptions requestOptions = null)
```

#### Parameters

`documentId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The document ID int the DB

`emailItemId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The emails ID in the DB

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[DocumentEntity](SuperOffice.WebApi.Data.DocumentEntity.md)\&gt;

The document

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_CreateNewPhysicalDocumentFromEmailAttachmentAsync\_System\_Int32\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateNewPhysicalDocumentFromEmailAttachmentAsync(int, int, string, RequestOptions)

Save the Email from the server as a document file connected to existing document
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<DocumentEntity> CreateNewPhysicalDocumentFromEmailAttachmentAsync(int documentId, int emailItemId, string attachmentId, RequestOptions requestOptions = null)
```

#### Parameters

`documentId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The document ID int the DB

`emailItemId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The emails ID int the DB

`attachmentId` [string](https://learn.microsoft.com/dotnet/api/system.string)

Id string of the attachment

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[DocumentEntity](SuperOffice.WebApi.Data.DocumentEntity.md)\&gt;

The document

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_DeleteAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_Int32\_\_\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteAsync(EMailConnectionInfo, int\[], string, RequestOptions)

Delete specified mail items
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task DeleteAsync(EMailConnectionInfo connectionInfo, int[] messageServerIds, string moveToFolder, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`messageServerIds` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

The e-mails to handle

`moveToFolder` [string](https://learn.microsoft.com/dotnet/api/system.string)

If set, move deleted items to this folder

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_DeleteEMailAccountAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteEMailAccountAsync(int, RequestOptions)

Deletes the EMailAccount
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task DeleteEMailAccountAsync(int eMailAccountId, RequestOptions requestOptions = null)
```

#### Parameters

`eMailAccountId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the EMailAccount

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_DeleteEmailsAsync\_System\_Int32\_\_\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteEmailsAsync(int\[], string, RequestOptions)

Delete specified mail items and optionally move to the specified folder
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task DeleteEmailsAsync(int[] ids, string moveToFolder, RequestOptions requestOptions = null)
```

#### Parameters

`ids` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

The e-mails to handle

`moveToFolder` [string](https://learn.microsoft.com/dotnet/api/system.string)

If set, move deleted items to this folder

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_DeleteExtendedAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfoExtended\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteExtendedAsync(EMailConnectionInfoExtended, string\[], RequestOptions)

\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task DeleteExtendedAsync(EMailConnectionInfoExtended connectionInfoExtended, string[] messageIds, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfoExtended` [EMailConnectionInfoExtended](SuperOffice.WebApi.Data.EMailConnectionInfoExtended.md)

`messageIds` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_DeleteFolderAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteFolderAsync(EMailConnectionInfo, RequestOptions)

Delete a folder from the server
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task DeleteFolderAsync(EMailConnectionInfo connectionInfo, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_DeleteFromServerIdentifierAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_String\_\_\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteFromServerIdentifierAsync(EMailConnectionInfo, string\[], string, RequestOptions)

Delete specified mail items
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task DeleteFromServerIdentifierAsync(EMailConnectionInfo connectionInfo, string[] messageServerIds, string moveToFolder, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`messageServerIds` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

The e-mails to handle

`moveToFolder` [string](https://learn.microsoft.com/dotnet/api/system.string)

If set, move deleted items to this folder

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_EmptyFolderAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> EmptyFolderAsync(EMailConnectionInfo, string, RequestOptions)

Delete all items in folder specified in the connection object
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task EmptyFolderAsync(EMailConnectionInfo connectionInfo, string moveToFolder, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`moveToFolder` [string](https://learn.microsoft.com/dotnet/api/system.string)

If set, move deleted items to this folder

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_FindAddressAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> FindAddressAsync(string, RequestOptions)

Search for contacts and persons with the specified e-mail address (exact match on the email address string required)
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAddress[]> FindAddressAsync(string address, RequestOptions requestOptions = null)
```

#### Parameters

`address` [string](https://learn.microsoft.com/dotnet/api/system.string)

E-mail address to look for

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAddress](SuperOffice.WebApi.Data.EMailAddress.md)\[]\&gt;

All resolved contacts/persons

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_FindContactOrPersonByEmailNameAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> FindContactOrPersonByEmailNameAsync(string, string, RequestOptions)

\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<ContactOrPersonFromEmail[]> FindContactOrPersonByEmailNameAsync(string name, string emailAddress, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The sender name

`emailAddress` [string](https://learn.microsoft.com/dotnet/api/system.string)

The sender email address

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ContactOrPersonFromEmail](SuperOffice.WebApi.Data.ContactOrPersonFromEmail.md)\[]\&gt;

Contacts and persons matching emailaddress and name

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_FindContactOrPersonByEmailNameWithLimitAsync\_System\_String\_System\_String\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> FindContactOrPersonByEmailNameWithLimitAsync(string, string, int, int, RequestOptions)

\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<ContactOrPersonFromEmail[]> FindContactOrPersonByEmailNameWithLimitAsync(string name, string emailAddress, int numberOfContacts, int numberOfPersons, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The sender name

`emailAddress` [string](https://learn.microsoft.com/dotnet/api/system.string)

The sender email address

`numberOfContacts` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Maximum returned number of contacts

`numberOfPersons` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Maximum returned number of persons

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ContactOrPersonFromEmail](SuperOffice.WebApi.Data.ContactOrPersonFromEmail.md)\[]\&gt;

Contacts and persons matching emailaddress and name

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetAttachmentAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAttachmentAsync(EMailConnectionInfo, int, string, RequestOptions)

Retrieve an attachment from an e-mail
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAttachment> GetAttachmentAsync(EMailConnectionInfo connectionInfo, int messageServerId, string attachmentId, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`messageServerId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Unique ID for the e-mail to retrieve the attachment from

`attachmentId` [string](https://learn.microsoft.com/dotnet/api/system.string)

Id of the attachment in the e-mail

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAttachment](SuperOffice.WebApi.Data.EMailAttachment.md)\&gt;

The attachment

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetAttachmentFromIdAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAttachmentFromIdAsync(int, string, RequestOptions)

Retrieve an attachment from an e-mail
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAttachment> GetAttachmentFromIdAsync(int mailItemId, string attachmentId, RequestOptions requestOptions = null)
```

#### Parameters

`mailItemId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Unique ID for the e-mail to retrieve the attachment from

`attachmentId` [string](https://learn.microsoft.com/dotnet/api/system.string)

Id of the attachment in the e-mail

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAttachment](SuperOffice.WebApi.Data.EMailAttachment.md)\&gt;

The attachment

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetAttachmentFromServerIdentifierAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAttachmentFromServerIdentifierAsync(EMailConnectionInfo, string, string, RequestOptions)

Retrieve an attachment from an e-mail
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAttachment> GetAttachmentFromServerIdentifierAsync(EMailConnectionInfo connectionInfo, string messageServerId, string attachmentId, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`messageServerId` [string](https://learn.microsoft.com/dotnet/api/system.string)

Unique ID for the e-mail to retrieve the attachment from

`attachmentId` [string](https://learn.microsoft.com/dotnet/api/system.string)

Id of the attachment in the e-mail

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAttachment](SuperOffice.WebApi.Data.EMailAttachment.md)\&gt;

The attachment

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetCurrentAccountAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCurrentAccountAsync(RequestOptions)

Get current account (last logged into should normally be current) for logged in associate
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAccount> GetCurrentAccountAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAccount](SuperOffice.WebApi.Data.EMailAccount.md)\&gt;

Id of current account

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetCurrentAccountIdAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCurrentAccountIdAsync(RequestOptions)

Get current accountId (last logged into should normally be current) for logged in associate
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<int> GetCurrentAccountIdAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

Id of current account

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailAccountAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailAccountAsync(int, RequestOptions)

Gets a specific EMailAccount object.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAccount> GetEMailAccountAsync(int eMailAccountId, RequestOptions requestOptions = null)
```

#### Parameters

`eMailAccountId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the EMailAccount object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAccount](SuperOffice.WebApi.Data.EMailAccount.md)\&gt;

EMailAccount

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailAccountFromEMailAddressAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailAccountFromEMailAddressAsync(string, RequestOptions)

Returns the email account corresponding to this email address (for the current associate).
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAccount> GetEMailAccountFromEMailAddressAsync(string fromAddress, RequestOptions requestOptions = null)
```

#### Parameters

`fromAddress` [string](https://learn.microsoft.com/dotnet/api/system.string)

The address associated with this email account

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAccount](SuperOffice.WebApi.Data.EMailAccount.md)\&gt;

Found or empty email account

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailAddressesAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailAddressesAsync(int\[], RequestOptions)

Get information about one or more email addresses, identified by IDs
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAddress[]> GetEMailAddressesAsync(int[] emailIds, RequestOptions requestOptions = null)
```

#### Parameters

`emailIds` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

Array of IDs from the email table, each identifying one email address

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAddress](SuperOffice.WebApi.Data.EMailAddress.md)\[]\&gt;

Array of email information objects

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailAsEmlStreamAsync\_System\_Int32\_System\_Boolean\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailAsEmlStreamAsync(int, bool, string, RequestOptions)

Get an inbox e-mail (by its EmailItemId) serialized as an Outlook-openable RFC822 (.eml) stream. Works for both IMAP and Graph/Exchange-Online mailboxes because it serializes the loaded entity instead of re-fetching the raw message by server id.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<byte[]> GetEMailAsEmlStreamAsync(int emailItemId, bool includeAttachments, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

`emailItemId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The EmailItemId of the e-mail to retrieve as stream

`includeAttachments` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Should attachments be included in the stream

`returnContentType` [string](https://learn.microsoft.com/dotnet/api/system.string)

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

Get an inbox e-mail (by its EmailItemId) serialized as an Outlook-openable RFC822 (.eml) stream

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailAsStreamAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_Int32\_System\_Boolean\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailAsStreamAsync(EMailConnectionInfo, int, bool, string, RequestOptions)

Retrieve an e-mail optionally stripping attachments as a stream
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<byte[]> GetEMailAsStreamAsync(EMailConnectionInfo connectionInfo, int messageServerId, bool stripAttachments, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`messageServerId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Unique ID for the e-mail to retrieve

`stripAttachments` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, do not include attachments in stream

`returnContentType` [string](https://learn.microsoft.com/dotnet/api/system.string)

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

The attachment as a stream

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailAsStreamFromServerIdentifierAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_String\_System\_Boolean\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailAsStreamFromServerIdentifierAsync(EMailConnectionInfo, string, bool, string, RequestOptions)

Retrieve an e-mail optionally stripping attachments as a stream
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<byte[]> GetEMailAsStreamFromServerIdentifierAsync(EMailConnectionInfo connectionInfo, string messageServerId, bool stripAttachments, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`messageServerId` [string](https://learn.microsoft.com/dotnet/api/system.string)

Unique ID for the e-mail to retrieve

`stripAttachments` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, do not include attachments in stream

`returnContentType` [string](https://learn.microsoft.com/dotnet/api/system.string)

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

The attachment as a stream

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailAsync\_System\_Int32\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailAsync(int, bool, RequestOptions)

Get en e-mail based on its primary key in the DB
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetEMailAsync(int id, bool includeAttachments, RequestOptions requestOptions = null)
```

#### Parameters

`id` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The primary key of the email row in the DB

`includeAttachments` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Should we retrieve attachments embedded in the e-mail from the server

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The e-mail

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailEnvelopesAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailEnvelopesAsync(EMailConnectionInfo, int\[], RequestOptions)

Retrieve a set of e-mail envelopes
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEnvelope[]> GetEMailEnvelopesAsync(EMailConnectionInfo connectionInfo, int[] messageServerIds, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`messageServerIds` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

Unique identitifiers for the e-mails to retrieve envelopes for

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEnvelope](SuperOffice.WebApi.Data.EMailEnvelope.md)\[]\&gt;

The e-mail envelope objects

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailEnvelopesFromServerIdsAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailEnvelopesFromServerIdsAsync(EMailConnectionInfo, string\[], RequestOptions)

Retrieve a set of e-mail envelopes
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEnvelope[]> GetEMailEnvelopesFromServerIdsAsync(EMailConnectionInfo connectionInfo, string[] messageServerIds, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`messageServerIds` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

Unique identitifiers for the e-mails to retrieve envelopes for

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEnvelope](SuperOffice.WebApi.Data.EMailEnvelope.md)\[]\&gt;

The e-mail envelope objects

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailFromAttachmentIdAsync\_System\_Int32\_System\_String\_\_\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailFromAttachmentIdAsync(int, string\[], bool, RequestOptions)

Get an e-mail based on an email and attachment id
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetEMailFromAttachmentIdAsync(int emailId, string[] attachmentIds, bool includeAttachments, RequestOptions requestOptions = null)
```

#### Parameters

`emailId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The primary key of the email row in the DB

`attachmentIds` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

Id of the attachment. If multiple elements this is treated as attachment in attachemnts, e.g. \[1, 2] means attachment 2 in attachment 1 of email.

`includeAttachments` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Should we retrieve attachments embedded in the e-mail from the server

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The attachment as an e-mail

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailFromDocumentAttachmentIdAsync\_System\_Int32\_System\_String\_\_\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailFromDocumentAttachmentIdAsync(int, string\[], bool, RequestOptions)

Get an e-mail based on an email in the archive system and attachment id
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetEMailFromDocumentAttachmentIdAsync(int docId, string[] attachmentIds, bool includeAttachments, RequestOptions requestOptions = null)
```

#### Parameters

`docId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The primary key of the document row in the DB

`attachmentIds` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

Id of the attachment. If multiple elements this is treated as attachment in attachemnts, e.g. \[1, 2] means attachment 2 in attachment 1 of email.

`includeAttachments` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Should we retrieve attachments embedded in the e-mail from the server

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The attachment as an e-mail

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailFromDocumentIdAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailFromDocumentIdAsync(int, RequestOptions)

Get an e-mail based on an archived document
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetEMailFromDocumentIdAsync(int documentId, RequestOptions requestOptions = null)
```

#### Parameters

`documentId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Unique id of the document

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The e-mail

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailFromDocumentIdWithoutAttachmentStreamAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailFromDocumentIdWithoutAttachmentStreamAsync(int, RequestOptions)

Get an e-mail based on an archived document
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetEMailFromDocumentIdWithoutAttachmentStreamAsync(int documentId, RequestOptions requestOptions = null)
```

#### Parameters

`documentId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Unique id of the document

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The e-mail

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailFromIdAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_Int32\_System\_Boolean\_SuperOffice\_WebApi\_Data\_EMailFlags\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailFromIdAsync(EMailConnectionInfo, int, bool, EMailFlags, bool, RequestOptions)

Get en e-mail based on its unique id
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetEMailFromIdAsync(EMailConnectionInfo connectionInfo, int messageServerId, bool lookupAddresses, EMailFlags flags, bool includeAttachments, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`messageServerId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Unique ID for the e-mail to retrieve

`lookupAddresses` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true try to look up e-mail addresses in from/to/cc/bcc fields against superoffice contacts

`flags` [EMailFlags](SuperOffice.WebApi.Data.EMailFlags.md)

Any flags to apply to the fetched item. Ex: Seen/Answered

`includeAttachments` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Should we retrieve attachments embedded in the e-mail from the server

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The e-mail

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailFromServerIdentifierAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_String\_System\_Boolean\_SuperOffice\_WebApi\_Data\_EMailFlags\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailFromServerIdentifierAsync(EMailConnectionInfo, string, bool, EMailFlags, bool, RequestOptions)

Get en e-mail based on its unique id string
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetEMailFromServerIdentifierAsync(EMailConnectionInfo connectionInfo, string messageServerId, bool lookupAddresses, EMailFlags flags, bool includeAttachments, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`messageServerId` [string](https://learn.microsoft.com/dotnet/api/system.string)

Unique ID for the e-mail to retrieve

`lookupAddresses` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true try to look up e-mail addresses in from/to/cc/bcc fields against superoffice contacts

`flags` [EMailFlags](SuperOffice.WebApi.Data.EMailFlags.md)

Any flags to apply to the fetched item. Ex: Seen/Answered

`includeAttachments` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Should we retrieve attachments embedded in the e-mail from the server

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The e-mail

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailFromTempAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailFromTempAsync(string, RequestOptions)

\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetEMailFromTempAsync(string fileName, RequestOptions requestOptions = null)
```

#### Parameters

`fileName` [string](https://learn.microsoft.com/dotnet/api/system.string)

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEMailSOInfoAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEMailSOInfoAsync(int, RequestOptions)

Gets a specific EMailSOInfo object.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailSOInfo> GetEMailSOInfoAsync(int eMailSOInfoId, RequestOptions requestOptions = null)
```

#### Parameters

`eMailSOInfoId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the EMailSOInfo object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailSOInfo](SuperOffice.WebApi.Data.EMailSOInfo.md)\&gt;

EMailSOInfo

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEmailAppointmentAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEmailAppointmentAsync(int, RequestOptions)

Get appointment data contained in the emails iCal attachment
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAppointment> GetEmailAppointmentAsync(int mailItemId, RequestOptions requestOptions = null)
```

#### Parameters

`mailItemId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Id identifying the email

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAppointment](SuperOffice.WebApi.Data.EMailAppointment.md)\&gt;

Appointment data

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEmailAppointmentRecurrenceAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEmailAppointmentRecurrenceAsync(int, RequestOptions)

Get recurrence data contained in the email iCal attachment
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<RecurrenceInfo> GetEmailAppointmentRecurrenceAsync(int mailItemId, RequestOptions requestOptions = null)
```

#### Parameters

`mailItemId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Id identifying the email

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[RecurrenceInfo](SuperOffice.WebApi.Data.RecurrenceInfo.md)\&gt;

Recurrence information

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEmailDocumentAsMimeStreamAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEmailDocumentAsMimeStreamAsync(int, string, RequestOptions)

Gets a particular document, and tries to parse it, and returns it in MIME/RFC822 format.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<byte[]> GetEmailDocumentAsMimeStreamAsync(int documentId, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

`documentId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

SuperOffice document ID

`returnContentType` [string](https://learn.microsoft.com/dotnet/api/system.string)

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

A document-stream representing the document in MIME/RFC822 format.

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEmailMessageIdsAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfoExtended\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEmailMessageIdsAsync(EMailConnectionInfoExtended, RequestOptions)

\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<string[]> GetEmailMessageIdsAsync(EMailConnectionInfoExtended connectionInfoExtended, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfoExtended` [EMailConnectionInfoExtended](SuperOffice.WebApi.Data.EMailConnectionInfoExtended.md)

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\[]\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetEmailsAsStringAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfoExtended\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEmailsAsStringAsync(EMailConnectionInfoExtended, string\[], RequestOptions)

\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<string[]> GetEmailsAsStringAsync(EMailConnectionInfoExtended connectionInfoExtended, string[] messageIds, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfoExtended` [EMailConnectionInfoExtended](SuperOffice.WebApi.Data.EMailConnectionInfoExtended.md)

`messageIds` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\[]\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetExtendedEmailMessageIdsAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfoExtended\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetExtendedEmailMessageIdsAsync(EMailConnectionInfoExtended, RequestOptions)

Gets not only the Message-Id's but also the UID's and the uniquevalidity property in this format-> uvalidity:uid:MsgId - and this format should be understood by GetEmailsAsString() and DeleteExtended().
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<string[]> GetExtendedEmailMessageIdsAsync(EMailConnectionInfoExtended connectionInfoExtended, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfoExtended` [EMailConnectionInfoExtended](SuperOffice.WebApi.Data.EMailConnectionInfoExtended.md)

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\[]\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetFolderEMailCountAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetFolderEMailCountAsync(EMailConnectionInfo, bool, RequestOptions)

Retrieve total/unread mail items in current folder
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<int> GetFolderEMailCountAsync(EMailConnectionInfo connectionInfo, bool onlyUnread, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`onlyUnread` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, only unread items are counted

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

Number of mail items

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetFolderHasNewEMailAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetFolderHasNewEMailAsync(EMailConnectionInfo, RequestOptions)

Check if folder has received new items since previous access.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<bool> GetFolderHasNewEMailAsync(EMailConnectionInfo connectionInfo, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

True if new mail is available.

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetFolderInfoAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetFolderInfoAsync(EMailConnectionInfo, string\[], RequestOptions)

Retrieve information about folders.  If folders parameter is not specified(null), information about all subscribed folders will be returned.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailFolder[]> GetFolderInfoAsync(EMailConnectionInfo connectionInfo, string[] folders, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`folders` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

Folders to get information about.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailFolder](SuperOffice.WebApi.Data.EMailFolder.md)\[]\&gt;

Folder information

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetFolderListAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetFolderListAsync(EMailConnectionInfo, bool, RequestOptions)

Retrieve all folders for the mail account. String is separated in sections by the paragraph character.  First section contains the folder delimeter char. Next is folder name. Additional sections may be unread and total items.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<string[]> GetFolderListAsync(EMailConnectionInfo connectionInfo, bool includeItemCount, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`includeItemCount` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, unread and total items are added to the foldername separated by a comma

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\[]\&gt;

List of available folders as a string array

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetMailFromInReplyToAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetMailFromInReplyToAsync(string, RequestOptions)

Get email from db based on In-Reply-To Message Id
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetMailFromInReplyToAsync(string messageId, RequestOptions requestOptions = null)
```

#### Parameters

`messageId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The message id

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

EMailEntity that is in reply to the provided messageId

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetMailFromMessageIdAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetMailFromMessageIdAsync(string, RequestOptions)

Get email from db based on Message Id
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetMailFromMessageIdAsync(string messageId, RequestOptions requestOptions = null)
```

#### Parameters

`messageId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The message id

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

EMailEntity with the provided message id

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetNewMailAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetNewMailAsync(int\[], RequestOptions)

Get new email in folder(s) for current associate
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEnvelope[]> GetNewMailAsync(int[] folders, RequestOptions requestOptions = null)
```

#### Parameters

`folders` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

List of folder ids to check for new email

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEnvelope](SuperOffice.WebApi.Data.EMailEnvelope.md)\[]\&gt;

The downloaded email envelopes

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetParticipantInfoFromEmailAddressAsync\_System\_String\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetParticipantInfoFromEmailAddressAsync(string, int, RequestOptions)

Get participant data associated with the participant in the emails iCal attachment
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<Person> GetParticipantInfoFromEmailAddressAsync(string emailAddress, int appointmentId, RequestOptions requestOptions = null)
```

#### Parameters

`emailAddress` [string](https://learn.microsoft.com/dotnet/api/system.string)

Email address of participant

`appointmentId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Appointment id of participant

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[Person](SuperOffice.WebApi.Data.Person.md)\&gt;

Person information

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetPersonEntitiesFromEmailAddressAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPersonEntitiesFromEmailAddressAsync(string, RequestOptions)

Get all persons and contacts with the given email address
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<PersonEntity[]> GetPersonEntitiesFromEmailAddressAsync(string emailAddress, RequestOptions requestOptions = null)
```

#### Parameters

`emailAddress` [string](https://learn.microsoft.com/dotnet/api/system.string)

The emailAddress to find persons and contacts for

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[PersonEntity](SuperOffice.WebApi.Data.PersonEntity.md)\[]\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetPersonsFromEmailAddressAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPersonsFromEmailAddressAsync(string, RequestOptions)

Get all persons and contacts with the given email address
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<Person[]> GetPersonsFromEmailAddressAsync(string emailAddress, RequestOptions requestOptions = null)
```

#### Parameters

`emailAddress` [string](https://learn.microsoft.com/dotnet/api/system.string)

The emailAddress to find persons and contacts for

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[Person](SuperOffice.WebApi.Data.Person.md)\[]\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetPreviewAttachmentFromDocIdAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPreviewAttachmentFromDocIdAsync(int, string, RequestOptions)

Retrieve an attachment from an e-mail stored in the document archive. The returned data is intended to be use for a preview.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAttachment> GetPreviewAttachmentFromDocIdAsync(int docId, string attachmentId, RequestOptions requestOptions = null)
```

#### Parameters

`docId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Unique ID for the e-mail in the document archive to retrieve the attachment from

`attachmentId` [string](https://learn.microsoft.com/dotnet/api/system.string)

Id of the attachment in the e-mail

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAttachment](SuperOffice.WebApi.Data.EMailAttachment.md)\&gt;

The attachment

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetPreviewAttachmentFromIdAsync\_System\_Int32\_System\_String\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPreviewAttachmentFromIdAsync(int, string, string, string, RequestOptions)

Retrieve an attachment from an e-mail. The returned data is intended to be use for a preview.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAttachment> GetPreviewAttachmentFromIdAsync(int mailItemId, string attachmentId, string attachmentType, string attachmentFilename, RequestOptions requestOptions = null)
```

#### Parameters

`mailItemId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Unique ID for the e-mail to retrieve the attachment from

`attachmentId` [string](https://learn.microsoft.com/dotnet/api/system.string)

Id of the attachment in the e-mail

`attachmentType` [string](https://learn.microsoft.com/dotnet/api/system.string)

Mimetype of the attachment. Must be set if attachmentId contains a chain.

`attachmentFilename` [string](https://learn.microsoft.com/dotnet/api/system.string)

Filename of the attachment. Must be set if attachmentId contains a chain.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAttachment](SuperOffice.WebApi.Data.EMailAttachment.md)\&gt;

The attachment

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetReadySyncEmailAccountsAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetReadySyncEmailAccountsAsync(RequestOptions)

Gets the list of SyncUserAccounts that should be synced, from mail server to SuperOffice database cache.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<SyncUserAccount[]> GetReadySyncEmailAccountsAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[SyncUserAccount](SuperOffice.WebApi.Data.SyncUserAccount.md)\[]\&gt;

List of accounts to sync

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetUnsanitizedEMailAsync\_System\_Int32\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUnsanitizedEMailAsync(int, bool, RequestOptions)

Get en e-mail based on its primary key in the DB. The returned value is not sanitized.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetUnsanitizedEMailAsync(int id, bool includeAttachments, RequestOptions requestOptions = null)
```

#### Parameters

`id` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The primary key of the email row in the DB

`includeAttachments` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Should we retrieve attachments embedded in the e-mail from the server

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The e-mail

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetUnsanitizedEMailFromAttachmentIdAsync\_System\_Int32\_System\_String\_\_\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUnsanitizedEMailFromAttachmentIdAsync(int, string\[], bool, RequestOptions)

Get an e-mail based on an email and attachment id. The returned value is not sanitized.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetUnsanitizedEMailFromAttachmentIdAsync(int emailId, string[] attachmentIds, bool includeAttachments, RequestOptions requestOptions = null)
```

#### Parameters

`emailId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The primary key of the email row in the DB

`attachmentIds` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

Id of the attachment. If multiple elements this is treated as attachment in attachemnts, e.g. \[1, 2] means attachment 2 in attachment 1 of email.

`includeAttachments` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Should we retrieve attachments embedded in the e-mail from the server

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The attachment as an e-mail

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetUnsanitizedEMailFromDocumentAttachmentIdAsync\_System\_Int32\_System\_String\_\_\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUnsanitizedEMailFromDocumentAttachmentIdAsync(int, string\[], bool, RequestOptions)

Get an e-mail based on an email in the archive system and attachment id. The returned value is not sanitized.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetUnsanitizedEMailFromDocumentAttachmentIdAsync(int docId, string[] attachmentIds, bool includeAttachments, RequestOptions requestOptions = null)
```

#### Parameters

`docId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The primary key of the document row in the DB

`attachmentIds` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

Id of the attachment. If multiple elements this is treated as attachment in attachemnts, e.g. \[1, 2] means attachment 2 in attachment 1 of email.

`includeAttachments` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Should we retrieve attachments embedded in the e-mail from the server

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The attachment as an e-mail

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetUnsanitizedEMailFromDocumentIdAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUnsanitizedEMailFromDocumentIdAsync(int, RequestOptions)

Get an e-mail based on an archived document. The returned value is not sanitized.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetUnsanitizedEMailFromDocumentIdAsync(int documentId, RequestOptions requestOptions = null)
```

#### Parameters

`documentId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Unique id of the document

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The e-mail

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetUnsanitizedEMailFromDocumentIdWithoutAttachmentStreamAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUnsanitizedEMailFromDocumentIdWithoutAttachmentStreamAsync(int, RequestOptions)

Get an e-mail based on an archived document. The returned value is not sanitized.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> GetUnsanitizedEMailFromDocumentIdWithoutAttachmentStreamAsync(int documentId, RequestOptions requestOptions = null)
```

#### Parameters

`documentId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Unique id of the document

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The e-mail

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetUnsanitizedPreviewAttachmentFromDocIdAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUnsanitizedPreviewAttachmentFromDocIdAsync(int, string, RequestOptions)

Retrieve an attachment from an e-mail stored in the document archive. The returned data is intended to be use for a preview. The returned data is not sanitized.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAttachment> GetUnsanitizedPreviewAttachmentFromDocIdAsync(int docId, string attachmentId, RequestOptions requestOptions = null)
```

#### Parameters

`docId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Unique ID for the e-mail in the document archive to retrieve the attachment from

`attachmentId` [string](https://learn.microsoft.com/dotnet/api/system.string)

Id of the attachment in the e-mail

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAttachment](SuperOffice.WebApi.Data.EMailAttachment.md)\&gt;

The attachment

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_GetUnsanitizedPreviewAttachmentFromIdAsync\_System\_Int32\_System\_String\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUnsanitizedPreviewAttachmentFromIdAsync(int, string, string, string, RequestOptions)

Retrieve an attachment from an e-mail. The returned data is intended to be use for a preview. The returned data is not sanitized.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAttachment> GetUnsanitizedPreviewAttachmentFromIdAsync(int mailItemId, string attachmentId, string attachmentType, string attachmentFilename, RequestOptions requestOptions = null)
```

#### Parameters

`mailItemId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Unique ID for the e-mail to retrieve the attachment from

`attachmentId` [string](https://learn.microsoft.com/dotnet/api/system.string)

Id of the attachment in the e-mail

`attachmentType` [string](https://learn.microsoft.com/dotnet/api/system.string)

Mimetype of the attachment. Must be set if attachmentId contains a chain.

`attachmentFilename` [string](https://learn.microsoft.com/dotnet/api/system.string)

Filename of the attachment. Must be set if attachmentId contains a chain.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAttachment](SuperOffice.WebApi.Data.EMailAttachment.md)\&gt;

The attachment

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_HasMXRecordAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> HasMXRecordAsync(string, RequestOptions)

Return true if there is one or more MX records in DNS for the given mail domain
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<bool> HasMXRecordAsync(string mailDomain, RequestOptions requestOptions = null)
```

#### Parameters

`mailDomain` [string](https://learn.microsoft.com/dotnet/api/system.string)

The mail domain to check. Normally this is the part after @ in an email address

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

True if there is at least one MX record

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_HasNewMailAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> HasNewMailAsync(int, int, RequestOptions)

Fast check for new mail in the database
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<bool> HasNewMailAsync(int mailItemId, int folderId, RequestOptions requestOptions = null)
```

#### Parameters

`mailItemId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The last known mailitemid

`folderId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The folderId for the folder to check for new mail

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

Has new mail if true

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_HasSPFRecordAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> HasSPFRecordAsync(string, string, RequestOptions)

Return true if target domain contains a SPF record which is under the given SPF record
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<bool> HasSPFRecordAsync(string sourceSpf, string targetDomain, RequestOptions requestOptions = null)
```

#### Parameters

`sourceSpf` [string](https://learn.microsoft.com/dotnet/api/system.string)

The SPF to match from

`targetDomain` [string](https://learn.microsoft.com/dotnet/api/system.string)

The domain to verify if it has at least one SPF record contained in the source SPF

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

True if a match is found

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_LatestItemIdByFolderAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> LatestItemIdByFolderAsync(int, RequestOptions)

Returns the latest id of the mail item by folder
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<int> LatestItemIdByFolderAsync(int folderId, RequestOptions requestOptions = null)
```

#### Parameters

`folderId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The folderId for the folder to check for the latest mail id

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

Mail Item id

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_MarkAsReadAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_Int32\_\_\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> MarkAsReadAsync(EMailConnectionInfo, int\[], bool, RequestOptions)

Mark one or more e-mails as (un)read
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task MarkAsReadAsync(EMailConnectionInfo connectionInfo, int[] messageServerIds, bool read, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`messageServerIds` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

The e-mails to handle

`read` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true mails are marked as read. If false mails are marked as unread.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_MarkAsReadFromServerIdentifiersAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_String\_\_\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> MarkAsReadFromServerIdentifiersAsync(EMailConnectionInfo, string\[], bool, RequestOptions)

Mark one or more e-mails as (un)read
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task MarkAsReadFromServerIdentifiersAsync(EMailConnectionInfo connectionInfo, string[] messageServerIds, bool read, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`messageServerIds` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

The e-mails to handle

`read` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true mails are marked as read. If false mails are marked as unread.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_MarkEmailsAsReadAsync\_System\_Int32\_\_\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> MarkEmailsAsReadAsync(int\[], bool, RequestOptions)

Mark one or more e-mails as (un)read
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task MarkEmailsAsReadAsync(int[] ids, bool read, RequestOptions requestOptions = null)
```

#### Parameters

`ids` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

The e-mails to handle

`read` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true mails are marked as read. If false mails are marked as unread.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_MoveEmailsToFolderAsync\_System\_Int32\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> MoveEmailsToFolderAsync(int, int\[], RequestOptions)

Move one or more emails to the specified folder in the DB, and on the server
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task MoveEmailsToFolderAsync(int folderId, int[] emailItemIds, RequestOptions requestOptions = null)
```

#### Parameters

`folderId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The EmailFolderId of the folder to move to

`emailItemIds` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

The emails to move

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_MoveEmailsToTrashAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> MoveEmailsToTrashAsync(int\[], RequestOptions)

Delete specified mail items and move to the Trash folder
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task MoveEmailsToTrashAsync(int[] ids, RequestOptions requestOptions = null)
```

#### Parameters

`ids` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

The e-mails to handle

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_MoveToFolderAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_Int32\_\_\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> MoveToFolderAsync(EMailConnectionInfo, int\[], string, RequestOptions)

Moved specified items from current folder to targetFolder
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task MoveToFolderAsync(EMailConnectionInfo connectionInfo, int[] messageServerIds, string targetFolder, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`messageServerIds` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

The e-mails to handle

`targetFolder` [string](https://learn.microsoft.com/dotnet/api/system.string)

Name of folder to move items to

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_MoveToFolderFromServerIdentifierAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_String\_\_\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> MoveToFolderFromServerIdentifierAsync(EMailConnectionInfo, string\[], string, RequestOptions)

Moved specified items from current folder to targetFolder
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task MoveToFolderFromServerIdentifierAsync(EMailConnectionInfo connectionInfo, string[] messageServerIds, string targetFolder, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`messageServerIds` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

The e-mails to handle

`targetFolder` [string](https://learn.microsoft.com/dotnet/api/system.string)

Name of folder to move items to

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_RefreshFolderAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RefreshFolderAsync(EMailConnectionInfo, string\[], RequestOptions)

Refresh the given folders - i.e., fetch data from the mail server and update the in-database cache. This may happen synchronously or as a batch task, the return value will be 0 if the processing was synchronous, or the batch task id if a batch task is used.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<int> RefreshFolderAsync(EMailConnectionInfo connectionInfo, string[] folders, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

Email connection info credentials

`folders` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

List of folder names to refresh

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

Batch task id, or 0 if the processing was synchronous

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_RefreshFolderForAssociateAsync\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RefreshFolderForAssociateAsync(string\[], RequestOptions)

Get all emails in folder(s) from current associate
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<string> RefreshFolderForAssociateAsync(string[] folders, RequestOptions requestOptions = null)
```

#### Parameters

`folders` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

List of folder names to refresh

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

JSON serialized string containing array of data about each folder

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_RelayMessageAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfoExtended\_System\_String\_System\_String\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RelayMessageAsync(EMailConnectionInfoExtended, string, string, string\[], RequestOptions)

\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task RelayMessageAsync(EMailConnectionInfoExtended connectionInfoExtended, string rfc822, string from, string[] recipients, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfoExtended` [EMailConnectionInfoExtended](SuperOffice.WebApi.Data.EMailConnectionInfoExtended.md)

`rfc822` [string](https://learn.microsoft.com/dotnet/api/system.string)

`from` [string](https://learn.microsoft.com/dotnet/api/system.string)

`recipients` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_ResolveEMailRecipientsAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ResolveEMailRecipientsAsync(string, RequestOptions)

Resolve separate emails from single string. Also lookup persons by emails.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAddress[]> ResolveEMailRecipientsAsync(string emailAddress, RequestOptions requestOptions = null)
```

#### Parameters

`emailAddress` [string](https://learn.microsoft.com/dotnet/api/system.string)

The string to lookup emails from

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAddress](SuperOffice.WebApi.Data.EMailAddress.md)\[]\&gt;

Resolved EMail recipients

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_SaveAsync\_SuperOffice\_WebApi\_Data\_EMailEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveAsync(EMailEntity, RequestOptions)

Save the e-mail back to the database
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> SaveAsync(EMailEntity email, RequestOptions requestOptions = null)
```

#### Parameters

`email` [EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)

The e-mail to save

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The updated saved entity

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_SaveDraftAsync\_SuperOffice\_WebApi\_Data\_EMailEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveDraftAsync(EMailEntity, RequestOptions)

Save the Email entity to the drafts folder
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> SaveDraftAsync(EMailEntity entity, RequestOptions requestOptions = null)
```

#### Parameters

`entity` [EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)

The entity to save

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The saved e-mail entity

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_SaveEMailAccountAsync\_SuperOffice\_WebApi\_Data\_EMailAccount\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveEMailAccountAsync(EMailAccount, RequestOptions)

Updates the existing EMailAccount or creates a new EMailAccount if the id parameter is 0.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailAccount> SaveEMailAccountAsync(EMailAccount eMailAccount, RequestOptions requestOptions = null)
```

#### Parameters

`eMailAccount` [EMailAccount](SuperOffice.WebApi.Data.EMailAccount.md)

The EMailAccount that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailAccount](SuperOffice.WebApi.Data.EMailAccount.md)\&gt;

New or updated EMailAccount

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_SaveEMailAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_SuperOffice\_WebApi\_Data\_EMailEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveEMailAsync(EMailConnectionInfo, EMailEntity, RequestOptions)

Save the passed e-mail back to the server
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> SaveEMailAsync(EMailConnectionInfo connectionInfo, EMailEntity email, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`email` [EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)

The e-mail to save

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The updated saved entity

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_SaveEmailToTmpDocumentAsync\_SuperOffice\_WebApi\_Data\_EMailEntity\_System\_Int32\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveEmailToTmpDocumentAsync(EMailEntity, int, bool, RequestOptions)

Save the Email as a tmp document ready to archive
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<string> SaveEmailToTmpDocumentAsync(EMailEntity email, int folderId, bool stripAttachments, RequestOptions requestOptions = null)
```

#### Parameters

`email` [EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)

The e-mail to save

`folderId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The folder id where the email is

`stripAttachments` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, do not include attachments in tmp document

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

Filename of the tmp document

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_SaveToMailServerAsync\_SuperOffice\_WebApi\_Data\_EMailEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveToMailServerAsync(EMailEntity, RequestOptions)

Save the passed e-mail back to the mail server
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity> SaveToMailServerAsync(EMailEntity email, RequestOptions requestOptions = null)
```

#### Parameters

`email` [EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)

The e-mail to save

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\&gt;

The updated saved entity

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_SendAndSaveEmailToTmpDocumentAsync\_SuperOffice\_WebApi\_Data\_EMailEntity\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SendAndSaveEmailToTmpDocumentAsync(EMailEntity, bool, RequestOptions)

Send the provided e-mail and create tmp document ready to archive
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<string> SendAndSaveEmailToTmpDocumentAsync(EMailEntity email, bool stripAttachments, RequestOptions requestOptions = null)
```

#### Parameters

`email` [EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)

The e-mail to send

`stripAttachments` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, do not include attachments in tmp document

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

Filename of the tmp document

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_SendAsync\_SuperOffice\_WebApi\_Data\_EMailEntity\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SendAsync(EMailEntity\[], RequestOptions)

Send the provided e-mails
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity[]> SendAsync(EMailEntity[] emails, RequestOptions requestOptions = null)
```

#### Parameters

`emails` [EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\[]

The e-mails to send

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\[]\&gt;

The sent e-mails (updated with message id etc.)

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_SendEMailsAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_SuperOffice\_WebApi\_Data\_EMailEntity\_\_\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SendEMailsAsync(EMailConnectionInfo, EMailEntity\[], EMailConnectionInfo, RequestOptions)

Send the provided e-mails
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EMailEntity[]> SendEMailsAsync(EMailConnectionInfo outgoingConnectionInfo, EMailEntity[] emails, EMailConnectionInfo sentItemsConnectionInfo, RequestOptions requestOptions = null)
```

#### Parameters

`outgoingConnectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`emails` [EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\[]

The e-mails to send

`sentItemsConnectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

If provided, save sent item(s) in the folder specified.  May be null.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EMailEntity](SuperOffice.WebApi.Data.EMailEntity.md)\[]\&gt;

The sent e-mails (updated with message id etc.)

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_SetRepliedAtAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetRepliedAtAsync(string, RequestOptions)

Set the replied\_at field based on the MessageID
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task SetRepliedAtAsync(string messageId, RequestOptions requestOptions = null)
```

#### Parameters

`messageId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The MessageID

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_SetSubscriptionAsync\_SuperOffice\_WebApi\_Data\_EMailConnectionInfo\_SuperOffice\_WebApi\_Data\_EMailFolder\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetSubscriptionAsync(EMailConnectionInfo, EMailFolder\[], RequestOptions)

Set subscription on or off on a set of folders
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task SetSubscriptionAsync(EMailConnectionInfo connectionInfo, EMailFolder[] folders, RequestOptions requestOptions = null)
```

#### Parameters

`connectionInfo` [EMailConnectionInfo](SuperOffice.WebApi.Data.EMailConnectionInfo.md)

All information needed to connect to the mailserver

`folders` [EMailFolder](SuperOffice.WebApi.Data.EMailFolder.md)\[]

Folders to set subscription value on

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_SyncEmailAccountAsync\_SuperOffice\_WebApi\_Data\_SyncUserAccount\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SyncEmailAccountAsync(SyncUserAccount, RequestOptions)

Sync the given account, from mail server to SuperOffice database cache. This API has no throttling, so please be careful with multiple concurrent calls. Mail servers may become angry.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task SyncEmailAccountAsync(SyncUserAccount syncUserAccount, RequestOptions requestOptions = null)
```

#### Parameters

`syncUserAccount` [SyncUserAccount](SuperOffice.WebApi.Data.SyncUserAccount.md)

Account to sync

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

A void return

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_SyncEmailAccountsAsync\_SuperOffice\_WebApi\_Data\_SyncUserAccount\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SyncEmailAccountsAsync(SyncUserAccount\[], RequestOptions)

Start syncing of the given accounts, from mail server to SuperOffice database cache. Only one of these API calls may run at a time. If one is already active, we return after 1 (one) second, with no indication that the sync was not really started. This is a way to throttle sync'ing to avoid making the mail servers angry at us. \<br/> There is an \<b>additional\</b> level of throttling within the implementation as well, limiting us to a maximum of 10 tasks, regardless of how many associates are to to be sync'ed. The outer, API-level lock is released when all those tasks are done.
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task SyncEmailAccountsAsync(SyncUserAccount[] syncUserAccounts, RequestOptions requestOptions = null)
```

#### Parameters

`syncUserAccounts` [SyncUserAccount](SuperOffice.WebApi.Data.SyncUserAccount.md)\[]

Accounts to sync

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

A void return

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_TestAuthenticateAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> TestAuthenticateAsync(RequestOptions)

Test if logged-in user has a working mail account
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<bool> TestAuthenticateAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_IEMailAgent\_ToggleSubscriptionAsync\_System\_Int32\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ToggleSubscriptionAsync(int, bool, RequestOptions)

Set subscription on or off on a set of folders
\<p>\</p>
\<b>Online Restricted:\</b> The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task ToggleSubscriptionAsync(int folderId, bool subscriptionStatus, RequestOptions requestOptions = null)
```

#### Parameters

`folderId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The folder id to set subscription value on

`subscriptionStatus` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

The subscription status to set

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value
