Show / Hide Table of Contents

Interface IEMailAgent

Interface for the EMail Agent Email connection, reading, sending

Online Restricted: This agent is not available in Online by default. Access must be requested specifically when app is registered.
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("EMail Agent", "Interface for the EMail Agent. Email connection, reading, sending")]
public interface IEMailAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;

using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
   using (EMailAgent agent = new EMailAgent())
   {
      // call methods on agent here...
   }
}

Methods

AuthenticateAsync(EMailConnectionInfoExtended, CancellationToken)

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<bool> AuthenticateAsync(EMailConnectionInfoExtended connectionInfoExtended, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfoExtended connectionInfoExtended
CancellationToken cancellationToken
Returns
Type Description
Task<bool>

AuthenticateIncomingAsync(EMailConnectionInfo, CancellationToken)

Authenticate against a mail-server to retrieve e-mails from

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<bool> AuthenticateIncomingAsync(EMailConnectionInfo connectionInfo, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

True if authentication was succcesfull

AuthenticateOutgoingAsync(EMailConnectionInfo, CancellationToken)

Authenticate against a mail server to send items with

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<bool> AuthenticateOutgoingAsync(EMailConnectionInfo connectionInfo, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

True if authentication was succcesfull

CacheFolderListAsync(CancellationToken)

Fetch list of folders from email server for the current account, and cache in DB

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailFolder[]> CacheFolderListAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<EMailFolder[]>

List of folders from mail server

CreateDefaultEMailAccountAsync(CancellationToken)

Loading default values into a new EMailAccount.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAccount> CreateDefaultEMailAccountAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<EMailAccount>

New EMailAccount with default values

CreateDefaultEMailAddressAsync(CancellationToken)

Loading default values into a new EMailAddress.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAddress> CreateDefaultEMailAddressAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<EMailAddress>

New EMailAddress with default values

CreateDefaultEMailAppointmentAsync(CancellationToken)

Loading default values into a new EMailAppointment.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAppointment> CreateDefaultEMailAppointmentAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<EMailAppointment>

New EMailAppointment with default values

CreateDefaultEMailAttachmentAsync(CancellationToken)

Loading default values into a new EMailAttachment.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAttachment> CreateDefaultEMailAttachmentAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<EMailAttachment>

New EMailAttachment with default values

CreateDefaultEMailConnectionInfoAsync(CancellationToken)

Loading default values into a new EMailConnectionInfo.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailConnectionInfo> CreateDefaultEMailConnectionInfoAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<EMailConnectionInfo>

New EMailConnectionInfo with default values

CreateDefaultEMailConnectionInfoExtendedAsync(CancellationToken)

Loading default values into a new EMailConnectionInfoExtended.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailConnectionInfoExtended> CreateDefaultEMailConnectionInfoExtendedAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<EMailConnectionInfoExtended>

New EMailConnectionInfoExtended with default values

CreateDefaultEMailCustomHeaderAsync(CancellationToken)

Loading default values into a new EMailCustomHeader.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailCustomHeader> CreateDefaultEMailCustomHeaderAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<EMailCustomHeader>

New EMailCustomHeader with default values

CreateDefaultEMailEntityAsync(CancellationToken)

Loading default values into a new EMailEntity.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> CreateDefaultEMailEntityAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

New EMailEntity with default values

CreateDefaultEMailEnvelopeAsync(CancellationToken)

Loading default values into a new EMailEnvelope.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEnvelope> CreateDefaultEMailEnvelopeAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<EMailEnvelope>

New EMailEnvelope with default values

CreateDefaultEMailFolderAsync(CancellationToken)

Loading default values into a new EMailFolder.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailFolder> CreateDefaultEMailFolderAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<EMailFolder>

New EMailFolder with default values

CreateDefaultEMailSOInfoAsync(CancellationToken)

Loading default values into a new EMailSOInfo.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailSOInfo> CreateDefaultEMailSOInfoAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<EMailSOInfo>

New EMailSOInfo with default values

CreateEMailFromDocumentEntityAsync(DocumentEntity, CancellationToken)

Get an e-mail based on the provided DocumentEntity

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> CreateEMailFromDocumentEntityAsync(DocumentEntity documentEntity, CancellationToken cancellationToken = default)
Parameters
Type Name Description
DocumentEntity documentEntity

DocumentEntity data

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The e-mail

CreateEMailFromMimeMessageAsync(string, CancellationToken)

Get an e-mail based on the provided MIME-message

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> CreateEMailFromMimeMessageAsync(string mimeMessage, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string mimeMessage

string representing a MIME-formatted message

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The e-mail

CreateFolderAsync(EMailConnectionInfo, CancellationToken)

Create a new folder on the server

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task CreateFolderAsync(EMailConnectionInfo connectionInfo, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

CancellationToken cancellationToken
Returns
Type Description
Task

CreateForwardEmailAsync(EMailEntity, CancellationToken)

Create forward email

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> CreateForwardEmailAsync(EMailEntity email, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailEntity email

The e-mail to forward

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The new forward email entity

CreateInlineHtmlHeaderAsync(EMailEntity, CancellationToken)

Create Outlook style HTML header to use in for instance reply entities and when printing

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<string> CreateInlineHtmlHeaderAsync(EMailEntity email, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailEntity email

The e-mail to generate header based on

CancellationToken cancellationToken
Returns
Type Description
Task<string>

The generated HTML header

CreateNewPhysicalDocumentFromEmailAsync(int, int, CancellationToken)

Save the Email from the server as a document file connected to existing document

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<DocumentEntity> CreateNewPhysicalDocumentFromEmailAsync(int documentId, int emailItemId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

The document ID int the DB

int emailItemId

The emails ID in the DB

CancellationToken cancellationToken
Returns
Type Description
Task<DocumentEntity>

The document

CreateNewPhysicalDocumentFromEmailAttachmentAsync(int, int, string, CancellationToken)

Save the Email from the server as a document file connected to existing document

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<DocumentEntity> CreateNewPhysicalDocumentFromEmailAttachmentAsync(int documentId, int emailItemId, string attachmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

The document ID int the DB

int emailItemId

The emails ID int the DB

string attachmentId

Id string of the attachment

CancellationToken cancellationToken
Returns
Type Description
Task<DocumentEntity>

The document

DeleteAsync(EMailConnectionInfo, int[], string, CancellationToken)

Delete specified mail items

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task DeleteAsync(EMailConnectionInfo connectionInfo, int[] messageServerIds, string moveToFolder, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

int[] messageServerIds

The e-mails to handle

string moveToFolder

If set, move deleted items to this folder

CancellationToken cancellationToken
Returns
Type Description
Task

DeleteEMailAccountAsync(int, CancellationToken)

Deletes the EMailAccount

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task DeleteEMailAccountAsync(int eMailAccountId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int eMailAccountId

The identity of the EMailAccount

CancellationToken cancellationToken
Returns
Type Description
Task

This method has no return value

DeleteEmailsAsync(int[], string, CancellationToken)

Delete specified mail items and optionally move to the specified folder

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task DeleteEmailsAsync(int[] ids, string moveToFolder, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int[] ids

The e-mails to handle

string moveToFolder

If set, move deleted items to this folder

CancellationToken cancellationToken
Returns
Type Description
Task

DeleteExtendedAsync(EMailConnectionInfoExtended, string[], CancellationToken)

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task DeleteExtendedAsync(EMailConnectionInfoExtended connectionInfoExtended, string[] messageIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfoExtended connectionInfoExtended
string[] messageIds
CancellationToken cancellationToken
Returns
Type Description
Task

DeleteFolderAsync(EMailConnectionInfo, CancellationToken)

Delete a folder from the server

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task DeleteFolderAsync(EMailConnectionInfo connectionInfo, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

CancellationToken cancellationToken
Returns
Type Description
Task

EmptyFolderAsync(EMailConnectionInfo, string, CancellationToken)

Delete all items in folder specified in the connection object

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task EmptyFolderAsync(EMailConnectionInfo connectionInfo, string moveToFolder, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

string moveToFolder

If set, move deleted items to this folder

CancellationToken cancellationToken
Returns
Type Description
Task

FindAddressAsync(string, CancellationToken)

Search for contacts and persons with the specified e-mail address (exact match on the email address string required)

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAddress[]> FindAddressAsync(string address, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string address

E-mail address to look for

CancellationToken cancellationToken
Returns
Type Description
Task<EMailAddress[]>

All resolved contacts/persons

FindContactOrPersonByEmailNameAsync(string, string, CancellationToken)

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<ContactOrPersonFromEmail[]> FindContactOrPersonByEmailNameAsync(string name, string emailAddress, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string name

The sender name

string emailAddress

The sender email address

CancellationToken cancellationToken
Returns
Type Description
Task<ContactOrPersonFromEmail[]>

Contacts and persons matching emailaddress and name

FindContactOrPersonByEmailNameWithLimitAsync(string, string, int, int, CancellationToken)

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<ContactOrPersonFromEmail[]> FindContactOrPersonByEmailNameWithLimitAsync(string name, string emailAddress, int numberOfContacts, int numberOfPersons, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string name

The sender name

string emailAddress

The sender email address

int numberOfContacts

Maximum returned number of contacts

int numberOfPersons

Maximum returned number of persons

CancellationToken cancellationToken
Returns
Type Description
Task<ContactOrPersonFromEmail[]>

Contacts and persons matching emailaddress and name

GetAttachmentAsync(EMailConnectionInfo, int, string, CancellationToken)

Retrieve an attachment from an e-mail

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAttachment> GetAttachmentAsync(EMailConnectionInfo connectionInfo, int messageServerId, string attachmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

int messageServerId

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

string attachmentId

Id of the attachment in the e-mail

CancellationToken cancellationToken
Returns
Type Description
Task<EMailAttachment>

The attachment

GetAttachmentFromIdAsync(int, string, CancellationToken)

Retrieve an attachment from an e-mail

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAttachment> GetAttachmentFromIdAsync(int mailItemId, string attachmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int mailItemId

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

string attachmentId

Id of the attachment in the e-mail

CancellationToken cancellationToken
Returns
Type Description
Task<EMailAttachment>

The attachment

GetCurrentAccountAsync(CancellationToken)

Get current account (last logged into should normally be current) for logged in associate

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAccount> GetCurrentAccountAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<EMailAccount>

Id of current account

GetCurrentAccountIdAsync(CancellationToken)

Get current accountId (last logged into should normally be current) for logged in associate

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<int> GetCurrentAccountIdAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<int>

Id of current account

GetEMailAccountAsync(int, CancellationToken)

Gets a EMailAccount object.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAccount> GetEMailAccountAsync(int eMailAccountId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int eMailAccountId

The identifier of the EMailAccount object

CancellationToken cancellationToken
Returns
Type Description
Task<EMailAccount>

A single EMailAccount

GetEMailAccountFromEMailAddressAsync(string, CancellationToken)

Returns the email account corresponding to this email address (for the current associate).

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAccount> GetEMailAccountFromEMailAddressAsync(string fromAddress, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string fromAddress

The address associated with this email account

CancellationToken cancellationToken
Returns
Type Description
Task<EMailAccount>

Found or empty email account

GetEMailAddressesAsync(int[], CancellationToken)

Get information about one or more email addresses, identified by IDs

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAddress[]> GetEMailAddressesAsync(int[] emailIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int[] emailIds

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

CancellationToken cancellationToken
Returns
Type Description
Task<EMailAddress[]>

Array of email information objects

GetEMailAsStreamAsync(EMailConnectionInfo, int, bool, CancellationToken)

Retrieve an e-mail optionally stripping attachments as a stream

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<Stream> GetEMailAsStreamAsync(EMailConnectionInfo connectionInfo, int messageServerId, bool stripAttachments, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

int messageServerId

Unique ID for the e-mail to retrieve

bool stripAttachments

If true, do not include attachments in stream

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

The attachment as a stream

GetEMailAsync(int, bool, CancellationToken)

Get en e-mail based on its primary key in the DB

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> GetEMailAsync(int id, bool includeAttachments, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int id

The primary key of the email row in the DB

bool includeAttachments

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

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The e-mail

GetEMailEnvelopesAsync(EMailConnectionInfo, int[], CancellationToken)

Retrieve a set of e-mail envelopes

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEnvelope[]> GetEMailEnvelopesAsync(EMailConnectionInfo connectionInfo, int[] messageServerIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

int[] messageServerIds

Unique identitifiers for the e-mails to retrieve envelopes for

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEnvelope[]>

The e-mail envelope objects

GetEMailFromAttachmentIdAsync(int, string[], bool, CancellationToken)

Get an e-mail based on an email and attachment id

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> GetEMailFromAttachmentIdAsync(int emailId, string[] attachmentIds, bool includeAttachments, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int emailId

The primary key of the email row in the DB

string[] attachmentIds

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.

bool includeAttachments

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

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The attachment as an e-mail

GetEMailFromDocumentAttachmentIdAsync(int, string[], bool, CancellationToken)

Get an e-mail based on an email in the archive system and attachment id

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> GetEMailFromDocumentAttachmentIdAsync(int docId, string[] attachmentIds, bool includeAttachments, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int docId

The primary key of the document row in the DB

string[] attachmentIds

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.

bool includeAttachments

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

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The attachment as an e-mail

GetEMailFromDocumentIdAsync(int, CancellationToken)

Get an e-mail based on an archived document

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> GetEMailFromDocumentIdAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

Unique id of the document

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The e-mail

GetEMailFromDocumentIdWithoutAttachmentStreamAsync(int, CancellationToken)

Get an e-mail based on an archived document

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> GetEMailFromDocumentIdWithoutAttachmentStreamAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

Unique id of the document

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The e-mail

GetEMailFromIdAsync(EMailConnectionInfo, int, bool, EMailFlags, bool, CancellationToken)

Get en e-mail based on its unique id

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> GetEMailFromIdAsync(EMailConnectionInfo connectionInfo, int messageServerId, bool lookupAddresses, EMailFlags flags, bool includeAttachments, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

int messageServerId

Unique ID for the e-mail to retrieve

bool lookupAddresses

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

EMailFlags flags

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

bool includeAttachments

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

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The e-mail

GetEMailFromTempAsync(string, CancellationToken)

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> GetEMailFromTempAsync(string fileName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string fileName
CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

GetEMailSOInfoAsync(int, CancellationToken)

Gets a EMailSOInfo object.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailSOInfo> GetEMailSOInfoAsync(int eMailSOInfoId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int eMailSOInfoId

The identifier of the EMailSOInfo object

CancellationToken cancellationToken
Returns
Type Description
Task<EMailSOInfo>

A single EMailSOInfo

GetEmailAppointmentAsync(int, CancellationToken)

Get appointment data contained in the emails iCal attachment

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAppointment> GetEmailAppointmentAsync(int mailItemId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int mailItemId

Id identifying the email

CancellationToken cancellationToken
Returns
Type Description
Task<EMailAppointment>

Appointment data

GetEmailAppointmentRecurrenceAsync(int, CancellationToken)

Get recurrence data contained in the email iCal attachment

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<RecurrenceInfo> GetEmailAppointmentRecurrenceAsync(int mailItemId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int mailItemId

Id identifying the email

CancellationToken cancellationToken
Returns
Type Description
Task<RecurrenceInfo>

Recurrence information

GetEmailDocumentAsMimeStreamAsync(int, CancellationToken)

Gets a particular document, and tries to parse it, and returns it in MIME/RFC822 format.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<Stream> GetEmailDocumentAsMimeStreamAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document ID

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

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

GetEmailMessageIdsAsync(EMailConnectionInfoExtended, CancellationToken)

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<string[]> GetEmailMessageIdsAsync(EMailConnectionInfoExtended connectionInfoExtended, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfoExtended connectionInfoExtended
CancellationToken cancellationToken
Returns
Type Description
Task<string[]>

GetEmailsAsStringAsync(EMailConnectionInfoExtended, string[], CancellationToken)

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<string[]> GetEmailsAsStringAsync(EMailConnectionInfoExtended connectionInfoExtended, string[] messageIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfoExtended connectionInfoExtended
string[] messageIds
CancellationToken cancellationToken
Returns
Type Description
Task<string[]>

GetExtendedEmailMessageIdsAsync(EMailConnectionInfoExtended, CancellationToken)

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().

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<string[]> GetExtendedEmailMessageIdsAsync(EMailConnectionInfoExtended connectionInfoExtended, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfoExtended connectionInfoExtended
CancellationToken cancellationToken
Returns
Type Description
Task<string[]>

GetFolderEMailCountAsync(EMailConnectionInfo, bool, CancellationToken)

Retrieve total/unread mail items in current folder

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<int> GetFolderEMailCountAsync(EMailConnectionInfo connectionInfo, bool onlyUnread, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

bool onlyUnread

If true, only unread items are counted

CancellationToken cancellationToken
Returns
Type Description
Task<int>

Number of mail items

GetFolderHasNewEMailAsync(EMailConnectionInfo, CancellationToken)

Check if folder has received new items since previous access.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<bool> GetFolderHasNewEMailAsync(EMailConnectionInfo connectionInfo, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

True if new mail is available.

GetFolderInfoAsync(EMailConnectionInfo, string[], CancellationToken)

Retrieve information about folders. If folders parameter is not specified(null), information about all subscribed folders will be returned.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailFolder[]> GetFolderInfoAsync(EMailConnectionInfo connectionInfo, string[] folders, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

string[] folders

Folders to get information about.

CancellationToken cancellationToken
Returns
Type Description
Task<EMailFolder[]>

Folder information

GetFolderListAsync(EMailConnectionInfo, bool, CancellationToken)

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.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<string[]> GetFolderListAsync(EMailConnectionInfo connectionInfo, bool includeItemCount, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

bool includeItemCount

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

CancellationToken cancellationToken
Returns
Type Description
Task<string[]>

List of available folders as a string array

GetMailFromInReplyToAsync(string, CancellationToken)

Get email from db based on In-Reply-To Message Id

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> GetMailFromInReplyToAsync(string messageId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string messageId

The message id

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

EMailEntity that is in reply to the provided messageId

GetMailFromMessageIdAsync(string, CancellationToken)

Get email from db based on Message Id

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> GetMailFromMessageIdAsync(string messageId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string messageId

The message id

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

EMailEntity with the provided message id

GetNewMailAsync(int[], CancellationToken)

Get new email in folder(s) for current associate

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEnvelope[]> GetNewMailAsync(int[] folders, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int[] folders

List of folder ids to check for new email

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEnvelope[]>

The downloaded email envelopes

GetParticipantInfoFromEmailAddressAsync(string, int, CancellationToken)

Get participant data associated with the participant in the emails iCal attachment

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<Person> GetParticipantInfoFromEmailAddressAsync(string emailAddress, int appointmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string emailAddress

Email address of participant

int appointmentId

Appointment id of participant

CancellationToken cancellationToken
Returns
Type Description
Task<Person>

Person information

GetPersonEntitiesFromEmailAddressAsync(string, CancellationToken)

Get all persons and contacts with the given email address

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<PersonEntity[]> GetPersonEntitiesFromEmailAddressAsync(string emailAddress, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string emailAddress

The emailAddress to find persons and contacts for

CancellationToken cancellationToken
Returns
Type Description
Task<PersonEntity[]>

GetPersonsFromEmailAddressAsync(string, CancellationToken)

Get all persons and contacts with the given email address

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<Person[]> GetPersonsFromEmailAddressAsync(string emailAddress, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string emailAddress

The emailAddress to find persons and contacts for

CancellationToken cancellationToken
Returns
Type Description
Task<Person[]>

GetPreviewAttachmentFromDocIdAsync(int, string, CancellationToken)

Retrieve an attachment from an e-mail stored in the document archive. The returned data is intended to be use for a preview.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAttachment> GetPreviewAttachmentFromDocIdAsync(int docId, string attachmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int docId

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

string attachmentId

Id of the attachment in the e-mail

CancellationToken cancellationToken
Returns
Type Description
Task<EMailAttachment>

The attachment

GetPreviewAttachmentFromIdAsync(int, string, string, string, CancellationToken)

Retrieve an attachment from an e-mail. The returned data is intended to be use for a preview.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAttachment> GetPreviewAttachmentFromIdAsync(int mailItemId, string attachmentId, string attachmentType, string attachmentFilename, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int mailItemId

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

string attachmentId

Id of the attachment in the e-mail

string attachmentType

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

string attachmentFilename

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

CancellationToken cancellationToken
Returns
Type Description
Task<EMailAttachment>

The attachment

GetReadySyncEmailAccountsAsync(CancellationToken)

Gets the list of SyncUserAccounts that should be synced, from mail server to SuperOffice database cache.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<SyncUserAccount[]> GetReadySyncEmailAccountsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<SyncUserAccount[]>

List of accounts to sync

GetUnsanitizedEMailAsync(int, bool, CancellationToken)

Get en e-mail based on its primary key in the DB. The returned value is not sanitized.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> GetUnsanitizedEMailAsync(int id, bool includeAttachments, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int id

The primary key of the email row in the DB

bool includeAttachments

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

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The e-mail

GetUnsanitizedEMailFromAttachmentIdAsync(int, string[], bool, CancellationToken)

Get an e-mail based on an email and attachment id. The returned value is not sanitized.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> GetUnsanitizedEMailFromAttachmentIdAsync(int emailId, string[] attachmentIds, bool includeAttachments, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int emailId

The primary key of the email row in the DB

string[] attachmentIds

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.

bool includeAttachments

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

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The attachment as an e-mail

GetUnsanitizedEMailFromDocumentAttachmentIdAsync(int, string[], bool, CancellationToken)

Get an e-mail based on an email in the archive system and attachment id. The returned value is not sanitized.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> GetUnsanitizedEMailFromDocumentAttachmentIdAsync(int docId, string[] attachmentIds, bool includeAttachments, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int docId

The primary key of the document row in the DB

string[] attachmentIds

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.

bool includeAttachments

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

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The attachment as an e-mail

GetUnsanitizedEMailFromDocumentIdAsync(int, CancellationToken)

Get an e-mail based on an archived document. The returned value is not sanitized.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> GetUnsanitizedEMailFromDocumentIdAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

Unique id of the document

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The e-mail

GetUnsanitizedEMailFromDocumentIdWithoutAttachmentStreamAsync(int, CancellationToken)

Get an e-mail based on an archived document. The returned value is not sanitized.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> GetUnsanitizedEMailFromDocumentIdWithoutAttachmentStreamAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

Unique id of the document

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The e-mail

GetUnsanitizedPreviewAttachmentFromDocIdAsync(int, string, CancellationToken)

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.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAttachment> GetUnsanitizedPreviewAttachmentFromDocIdAsync(int docId, string attachmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int docId

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

string attachmentId

Id of the attachment in the e-mail

CancellationToken cancellationToken
Returns
Type Description
Task<EMailAttachment>

The attachment

GetUnsanitizedPreviewAttachmentFromIdAsync(int, string, string, string, CancellationToken)

Retrieve an attachment from an e-mail. The returned data is intended to be use for a preview. The returned data is not sanitized.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAttachment> GetUnsanitizedPreviewAttachmentFromIdAsync(int mailItemId, string attachmentId, string attachmentType, string attachmentFilename, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int mailItemId

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

string attachmentId

Id of the attachment in the e-mail

string attachmentType

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

string attachmentFilename

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

CancellationToken cancellationToken
Returns
Type Description
Task<EMailAttachment>

The attachment

HasMXRecordAsync(string, CancellationToken)

Return true if there is one or more MX records in DNS for the given mail domain

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<bool> HasMXRecordAsync(string mailDomain, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string mailDomain

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

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

True if there is at least one MX record

HasNewMailAsync(int, int, CancellationToken)

Fast check for new mail in the database

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<bool> HasNewMailAsync(int mailItemId, int folderId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int mailItemId

The last known mailitemid

int folderId

The folderId for the folder to check for new mail

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

Has new mail if true

HasSPFRecordAsync(string, string, CancellationToken)

Return true if target domain contains a SPF record which is under the given SPF record

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<bool> HasSPFRecordAsync(string sourceSpf, string targetDomain, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string sourceSpf

The SPF to match from

string targetDomain

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

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

True if a match is found

LatestItemIdByFolderAsync(int, CancellationToken)

Returns the latest id of the mail item by folder

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<int> LatestItemIdByFolderAsync(int folderId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int folderId

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

CancellationToken cancellationToken
Returns
Type Description
Task<int>

Mail Item id

MarkAsReadAsync(EMailConnectionInfo, int[], bool, CancellationToken)

Mark one or more e-mails as (un)read

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task MarkAsReadAsync(EMailConnectionInfo connectionInfo, int[] messageServerIds, bool read, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

int[] messageServerIds

The e-mails to handle

bool read

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

CancellationToken cancellationToken
Returns
Type Description
Task

MarkEmailsAsReadAsync(int[], bool, CancellationToken)

Mark one or more e-mails as (un)read

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task MarkEmailsAsReadAsync(int[] ids, bool read, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int[] ids

The e-mails to handle

bool read

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

CancellationToken cancellationToken
Returns
Type Description
Task

MoveEmailsToFolderAsync(int, int[], CancellationToken)

Move one or more emails to the specified folder in the DB, and on the server

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task MoveEmailsToFolderAsync(int folderId, int[] emailItemIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int folderId

The EmailFolderId of the folder to move to

int[] emailItemIds

The emails to move

CancellationToken cancellationToken
Returns
Type Description
Task

MoveEmailsToTrashAsync(int[], CancellationToken)

Delete specified mail items and move to the Trash folder

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task MoveEmailsToTrashAsync(int[] ids, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int[] ids

The e-mails to handle

CancellationToken cancellationToken
Returns
Type Description
Task

MoveToFolderAsync(EMailConnectionInfo, int[], string, CancellationToken)

Moved specified items from current folder to targetFolder

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task MoveToFolderAsync(EMailConnectionInfo connectionInfo, int[] messageServerIds, string targetFolder, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

int[] messageServerIds

The e-mails to handle

string targetFolder

Name of folder to move items to

CancellationToken cancellationToken
Returns
Type Description
Task

RefreshFolderAsync(EMailConnectionInfo, string[], CancellationToken)

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.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<int> RefreshFolderAsync(EMailConnectionInfo connectionInfo, string[] folders, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

Email connection info credentials

string[] folders

List of folder names to refresh

CancellationToken cancellationToken
Returns
Type Description
Task<int>

Batch task id, or 0 if the processing was synchronous

RefreshFolderForAssociateAsync(string[], CancellationToken)

Get all emails in folder(s) from current associate

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<string> RefreshFolderForAssociateAsync(string[] folders, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string[] folders

List of folder names to refresh

CancellationToken cancellationToken
Returns
Type Description
Task<string>

JSON serialized string containing array of data about each folder

RelayMessageAsync(EMailConnectionInfoExtended, string, string, string[], CancellationToken)

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task RelayMessageAsync(EMailConnectionInfoExtended connectionInfoExtended, string rfc822, string from, string[] recipients, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfoExtended connectionInfoExtended
string rfc822
string from
string[] recipients
CancellationToken cancellationToken
Returns
Type Description
Task

ResolveEMailRecipientsAsync(string, CancellationToken)

Resolve separate emails from single string. Also lookup persons by emails.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAddress[]> ResolveEMailRecipientsAsync(string emailAddress, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string emailAddress

The string to lookup emails from

CancellationToken cancellationToken
Returns
Type Description
Task<EMailAddress[]>

Resolved EMail recipients

SaveAsync(EMailEntity, CancellationToken)

Save the e-mail back to the database

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> SaveAsync(EMailEntity email, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailEntity email

The e-mail to save

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The updated saved entity

SaveDraftAsync(EMailEntity, CancellationToken)

Save the Email entity to the drafts folder

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> SaveDraftAsync(EMailEntity entity, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailEntity entity

The entity to save

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The saved e-mail entity

SaveEMailAccountAsync(EMailAccount, CancellationToken)

Updates the existing EMailAccount or creates a new EMailAccount if the id parameter is 0.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailAccount> SaveEMailAccountAsync(EMailAccount eMailAccount, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailAccount eMailAccount

The EMailAccount that is saved

CancellationToken cancellationToken
Returns
Type Description
Task<EMailAccount>

New or updated EMailAccount

SaveEMailAsync(EMailConnectionInfo, EMailEntity, CancellationToken)

Save the passed e-mail back to the server

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> SaveEMailAsync(EMailConnectionInfo connectionInfo, EMailEntity email, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

EMailEntity email

The e-mail to save

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The updated saved entity

SaveEmailToTmpDocumentAsync(EMailEntity, int, bool, CancellationToken)

Save the Email as a tmp document ready to archive

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<string> SaveEmailToTmpDocumentAsync(EMailEntity email, int folderId, bool stripAttachments, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailEntity email

The e-mail to save

int folderId

The folder id where the email is

bool stripAttachments

If true, do not include attachments in tmp document

CancellationToken cancellationToken
Returns
Type Description
Task<string>

Filename of the tmp document

SaveToMailServerAsync(EMailEntity, CancellationToken)

Save the passed e-mail back to the mail server

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity> SaveToMailServerAsync(EMailEntity email, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailEntity email

The e-mail to save

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity>

The updated saved entity

SendAndSaveEmailToTmpDocumentAsync(EMailEntity, bool, CancellationToken)

Send the provided e-mail and create tmp document ready to archive

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<string> SendAndSaveEmailToTmpDocumentAsync(EMailEntity email, bool stripAttachments, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailEntity email

The e-mail to send

bool stripAttachments

If true, do not include attachments in tmp document

CancellationToken cancellationToken
Returns
Type Description
Task<string>

Filename of the tmp document

SendAsync(EMailEntity[], CancellationToken)

Send the provided e-mails

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity[]> SendAsync(EMailEntity[] emails, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailEntity[] emails

The e-mails to send

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity[]>

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

SendEMailsAsync(EMailConnectionInfo, EMailEntity[], EMailConnectionInfo, CancellationToken)

Send the provided e-mails

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<EMailEntity[]> SendEMailsAsync(EMailConnectionInfo outgoingConnectionInfo, EMailEntity[] emails, EMailConnectionInfo sentItemsConnectionInfo, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo outgoingConnectionInfo

All information needed to connect to the mailserver

EMailEntity[] emails

The e-mails to send

EMailConnectionInfo sentItemsConnectionInfo

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

CancellationToken cancellationToken
Returns
Type Description
Task<EMailEntity[]>

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

SetRepliedAtAsync(string, CancellationToken)

Set the replied_at field based on the MessageID

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task SetRepliedAtAsync(string messageId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string messageId

The MessageID

CancellationToken cancellationToken
Returns
Type Description
Task

SetSubscriptionAsync(EMailConnectionInfo, EMailFolder[], CancellationToken)

Set subscription on or off on a set of folders

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task SetSubscriptionAsync(EMailConnectionInfo connectionInfo, EMailFolder[] folders, CancellationToken cancellationToken = default)
Parameters
Type Name Description
EMailConnectionInfo connectionInfo

All information needed to connect to the mailserver

EMailFolder[] folders

Folders to set subscription value on

CancellationToken cancellationToken
Returns
Type Description
Task

SyncEmailAccountAsync(SyncUserAccount, CancellationToken)

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.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task SyncEmailAccountAsync(SyncUserAccount syncUserAccount, CancellationToken cancellationToken = default)
Parameters
Type Name Description
SyncUserAccount syncUserAccount

Account to sync

CancellationToken cancellationToken
Returns
Type Description
Task

A void return

SyncEmailAccountsAsync(SyncUserAccount[], CancellationToken)

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.

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task SyncEmailAccountsAsync(SyncUserAccount[] syncUserAccounts, CancellationToken cancellationToken = default)
Parameters
Type Name Description
SyncUserAccount[] syncUserAccounts

Accounts to sync

CancellationToken cancellationToken
Returns
Type Description
Task

A void return

TestAuthenticateAsync(CancellationToken)

Test if logged-in user has a working mail account

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task<bool> TestAuthenticateAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<bool>

ToggleSubscriptionAsync(int, bool, CancellationToken)

Set subscription on or off on a set of folders

Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Declaration
Task ToggleSubscriptionAsync(int folderId, bool subscriptionStatus, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int folderId

The folder id to set subscription value on

bool subscriptionStatus

The subscription status to set

CancellationToken cancellationToken
Returns
Type Description
Task
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top