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
Authenticate(EMailConnectionInfoExtended)
Declaration
bool Authenticate(EMailConnectionInfoExtended connectionInfoExtended)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfoExtended | connectionInfoExtended |
Returns
Type | Description |
---|---|
Boolean |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
AuthenticateIncoming(EMailConnectionInfo)
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
bool AuthenticateIncoming(EMailConnectionInfo connectionInfo)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
Returns
Type | Description |
---|---|
Boolean | True if authentication was succcesfull |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
AuthenticateOutgoing(EMailConnectionInfo)
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
bool AuthenticateOutgoing(EMailConnectionInfo connectionInfo)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
Returns
Type | Description |
---|---|
Boolean | True if authentication was succcesfull |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CacheFolderList()
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
EMailFolder[] CacheFolderList()
Returns
Type | Description |
---|---|
EMailFolder[] | List of folders from mail server |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateDefaultEMailAccount()
Loading default values into a new EMailAccount. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
EMailAccount CreateDefaultEMailAccount()
Returns
Type | Description |
---|---|
EMailAccount | New EMailAccount with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateDefaultEMailAddress()
Loading default values into a new EMailAddress. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
EMailAddress CreateDefaultEMailAddress()
Returns
Type | Description |
---|---|
EMailAddress | New EMailAddress with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateDefaultEMailAppointment()
Loading default values into a new EMailAppointment. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
EMailAppointment CreateDefaultEMailAppointment()
Returns
Type | Description |
---|---|
EMailAppointment | New EMailAppointment with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateDefaultEMailAttachment()
Loading default values into a new EMailAttachment. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
EMailAttachment CreateDefaultEMailAttachment()
Returns
Type | Description |
---|---|
EMailAttachment | New EMailAttachment with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateDefaultEMailConnectionInfo()
Loading default values into a new EMailConnectionInfo. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
EMailConnectionInfo CreateDefaultEMailConnectionInfo()
Returns
Type | Description |
---|---|
EMailConnectionInfo | New EMailConnectionInfo with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateDefaultEMailConnectionInfoExtended()
Loading default values into a new EMailConnectionInfoExtended. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
EMailConnectionInfoExtended CreateDefaultEMailConnectionInfoExtended()
Returns
Type | Description |
---|---|
EMailConnectionInfoExtended | New EMailConnectionInfoExtended with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateDefaultEMailCustomHeader()
Loading default values into a new EMailCustomHeader. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
EMailCustomHeader CreateDefaultEMailCustomHeader()
Returns
Type | Description |
---|---|
EMailCustomHeader | New EMailCustomHeader with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateDefaultEMailEntity()
Loading default values into a new EMailEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
EMailEntity CreateDefaultEMailEntity()
Returns
Type | Description |
---|---|
EMailEntity | New EMailEntity with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateDefaultEMailEnvelope()
Loading default values into a new EMailEnvelope. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
EMailEnvelope CreateDefaultEMailEnvelope()
Returns
Type | Description |
---|---|
EMailEnvelope | New EMailEnvelope with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateDefaultEMailFolder()
Loading default values into a new EMailFolder. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
EMailFolder CreateDefaultEMailFolder()
Returns
Type | Description |
---|---|
EMailFolder | New EMailFolder with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateDefaultEMailSOInfo()
Loading default values into a new EMailSOInfo. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
EMailSOInfo CreateDefaultEMailSOInfo()
Returns
Type | Description |
---|---|
EMailSOInfo | New EMailSOInfo with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateEMailFromDocumentEntity(DocumentEntity)
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
EMailEntity CreateEMailFromDocumentEntity(DocumentEntity documentEntity)
Parameters
Type | Name | Description |
---|---|---|
DocumentEntity | documentEntity | DocumentEntity data |
Returns
Type | Description |
---|---|
EMailEntity | The e-mail |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateEMailFromMimeMessage(String)
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
EMailEntity CreateEMailFromMimeMessage(string mimeMessage)
Parameters
Type | Name | Description |
---|---|---|
String | mimeMessage | string representing a MIME-formatted message |
Returns
Type | Description |
---|---|
EMailEntity | The e-mail |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateFolder(EMailConnectionInfo)
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
void CreateFolder(EMailConnectionInfo connectionInfo)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateForwardEmail(EMailEntity)
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
EMailEntity CreateForwardEmail(EMailEntity email)
Parameters
Type | Name | Description |
---|---|---|
EMailEntity | The e-mail to forward |
Returns
Type | Description |
---|---|
EMailEntity | The new forward email entity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateInlineHtmlHeader(EMailEntity)
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
string CreateInlineHtmlHeader(EMailEntity email)
Parameters
Type | Name | Description |
---|---|---|
EMailEntity | The e-mail to generate header based on |
Returns
Type | Description |
---|---|
String | The generated HTML header |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateNewPhysicalDocumentFromEmail(Int32, Int32)
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
DocumentEntity CreateNewPhysicalDocumentFromEmail(int documentId, int emailItemId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | The document ID int the DB |
Int32 | emailItemId | The emails ID in the DB |
Returns
Type | Description |
---|---|
DocumentEntity | The document |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
CreateNewPhysicalDocumentFromEmailAttachment(Int32, Int32, String)
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
DocumentEntity CreateNewPhysicalDocumentFromEmailAttachment(int documentId, int emailItemId, string attachmentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | The document ID int the DB |
Int32 | emailItemId | The emails ID int the DB |
String | attachmentId | Id string of the attachment |
Returns
Type | Description |
---|---|
DocumentEntity | The document |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
Delete(EMailConnectionInfo, Int32[], String)
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
void Delete(EMailConnectionInfo connectionInfo, int[] messageServerIds, string moveToFolder)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
Int32[] | messageServerIds | The e-mails to handle |
String | moveToFolder | If set, move deleted items to this folder |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
DeleteEMailAccount(Int32)
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
void DeleteEMailAccount(int eMailAccountId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | eMailAccountId | The identity of the EMailAccount |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
DeleteEmails(Int32[], String)
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
void DeleteEmails(int[] ids, string moveToFolder)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | ids | The e-mails to handle |
String | moveToFolder | If set, move deleted items to this folder |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
DeleteExtended(EMailConnectionInfoExtended, String[])
Declaration
void DeleteExtended(EMailConnectionInfoExtended connectionInfoExtended, string[] messageIds)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfoExtended | connectionInfoExtended | |
String[] | messageIds |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
DeleteFolder(EMailConnectionInfo)
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
void DeleteFolder(EMailConnectionInfo connectionInfo)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
EmptyFolder(EMailConnectionInfo, String)
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
void EmptyFolder(EMailConnectionInfo connectionInfo, string moveToFolder)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
String | moveToFolder | If set, move deleted items to this folder |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
FindAddress(String)
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
EMailAddress[] FindAddress(string address)
Parameters
Type | Name | Description |
---|---|---|
String | address | E-mail address to look for |
Returns
Type | Description |
---|---|
EMailAddress[] | All resolved contacts/persons |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
FindContactOrPersonByEmailName(String, String)
Declaration
ContactOrPersonFromEmail[] FindContactOrPersonByEmailName(string name, string emailAddress)
Parameters
Type | Name | Description |
---|---|---|
String | name | The sender name |
String | emailAddress | The sender email address |
Returns
Type | Description |
---|---|
ContactOrPersonFromEmail[] | Contacts and persons matching emailaddress and name |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
FindContactOrPersonByEmailNameWithLimit(String, String, Int32, Int32)
Declaration
ContactOrPersonFromEmail[] FindContactOrPersonByEmailNameWithLimit(string name, string emailAddress, int numberOfContacts, int numberOfPersons)
Parameters
Type | Name | Description |
---|---|---|
String | name | The sender name |
String | emailAddress | The sender email address |
Int32 | numberOfContacts | Maximum returned number of contacts |
Int32 | numberOfPersons | Maximum returned number of persons |
Returns
Type | Description |
---|---|
ContactOrPersonFromEmail[] | Contacts and persons matching emailaddress and name |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetAttachment(EMailConnectionInfo, Int32, String)
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
EMailAttachment GetAttachment(EMailConnectionInfo connectionInfo, int messageServerId, string attachmentId)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
Int32 | messageServerId | Unique ID for the e-mail to retrieve the attachment from |
String | attachmentId | Id of the attachment in the e-mail |
Returns
Type | Description |
---|---|
EMailAttachment | The attachment |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetAttachmentFromId(Int32, String)
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
EMailAttachment GetAttachmentFromId(int mailItemId, string attachmentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | mailItemId | Unique ID for the e-mail to retrieve the attachment from |
String | attachmentId | Id of the attachment in the e-mail |
Returns
Type | Description |
---|---|
EMailAttachment | The attachment |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetCurrentAccount()
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
EMailAccount GetCurrentAccount()
Returns
Type | Description |
---|---|
EMailAccount | Id of current account |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetCurrentAccountId()
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
int GetCurrentAccountId()
Returns
Type | Description |
---|---|
Int32 | Id of current account |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEMail(Int32, Boolean)
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
EMailEntity GetEMail(int id, bool includeAttachments)
Parameters
Type | Name | Description |
---|---|---|
Int32 | id | The primary key of the email row in the DB |
Boolean | includeAttachments | Should we retrieve attachments embedded in the e-mail from the server |
Returns
Type | Description |
---|---|
EMailEntity | The e-mail |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEMailAccount(Int32)
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
EMailAccount GetEMailAccount(int eMailAccountId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | eMailAccountId | The identifier of the EMailAccount object |
Returns
Type | Description |
---|---|
EMailAccount | EMailAccount |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEMailAccountFromEMailAddress(String)
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
EMailAccount GetEMailAccountFromEMailAddress(string fromAddress)
Parameters
Type | Name | Description |
---|---|---|
String | fromAddress | The address associated with this email account |
Returns
Type | Description |
---|---|
EMailAccount | Found or empty email account |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEMailAddresses(Int32[])
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
EMailAddress[] GetEMailAddresses(int[] emailIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | emailIds | Array of IDs from the email table, each identifying one email address |
Returns
Type | Description |
---|---|
EMailAddress[] | Array of email information objects |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEmailAppointment(Int32)
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
EMailAppointment GetEmailAppointment(int mailItemId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | mailItemId | Id identifying the email |
Returns
Type | Description |
---|---|
EMailAppointment | Appointment data |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEmailAppointmentRecurrence(Int32)
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
RecurrenceInfo GetEmailAppointmentRecurrence(int mailItemId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | mailItemId | Id identifying the email |
Returns
Type | Description |
---|---|
RecurrenceInfo | Recurrence information |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEMailAsStream(EMailConnectionInfo, Int32, Boolean)
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
Stream GetEMailAsStream(EMailConnectionInfo connectionInfo, int messageServerId, bool stripAttachments)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
Int32 | messageServerId | Unique ID for the e-mail to retrieve |
Boolean | stripAttachments | If true, do not include attachments in stream |
Returns
Type | Description |
---|---|
Stream | The attachment as a stream |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEmailDocumentAsMimeStream(Int32)
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
Stream GetEmailDocumentAsMimeStream(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document ID |
Returns
Type | Description |
---|---|
Stream | A document-stream representing the document in MIME/RFC822 format. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEMailEnvelopes(EMailConnectionInfo, Int32[])
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
EMailEnvelope[] GetEMailEnvelopes(EMailConnectionInfo connectionInfo, int[] messageServerIds)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
Int32[] | messageServerIds | Unique identitifiers for the e-mails to retrieve envelopes for |
Returns
Type | Description |
---|---|
EMailEnvelope[] | The e-mail envelope objects |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEMailFromAttachmentId(Int32, String[], Boolean)
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
EMailEntity GetEMailFromAttachmentId(int emailId, string[] attachmentIds, bool includeAttachments)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Boolean | includeAttachments | Should we retrieve attachments embedded in the e-mail from the server |
Returns
Type | Description |
---|---|
EMailEntity | The attachment as an e-mail |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEMailFromDocumentAttachmentId(Int32, String[], Boolean)
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
EMailEntity GetEMailFromDocumentAttachmentId(int docId, string[] attachmentIds, bool includeAttachments)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Boolean | includeAttachments | Should we retrieve attachments embedded in the e-mail from the server |
Returns
Type | Description |
---|---|
EMailEntity | The attachment as an e-mail |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEMailFromDocumentId(Int32)
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
EMailEntity GetEMailFromDocumentId(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | Unique id of the document |
Returns
Type | Description |
---|---|
EMailEntity | The e-mail |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEMailFromDocumentIdWithoutAttachmentStream(Int32)
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
EMailEntity GetEMailFromDocumentIdWithoutAttachmentStream(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | Unique id of the document |
Returns
Type | Description |
---|---|
EMailEntity | The e-mail |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEMailFromId(EMailConnectionInfo, Int32, Boolean, EMailFlags, Boolean)
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
EMailEntity GetEMailFromId(EMailConnectionInfo connectionInfo, int messageServerId, bool lookupAddresses, EMailFlags flags, bool includeAttachments)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
Int32 | messageServerId | Unique ID for the e-mail to retrieve |
Boolean | 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 |
Boolean | includeAttachments | Should we retrieve attachments embedded in the e-mail from the server |
Returns
Type | Description |
---|---|
EMailEntity | The e-mail |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEMailFromTemp(String)
Declaration
EMailEntity GetEMailFromTemp(string fileName)
Parameters
Type | Name | Description |
---|---|---|
String | fileName |
Returns
Type | Description |
---|---|
EMailEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEmailMessageIds(EMailConnectionInfoExtended)
Declaration
string[] GetEmailMessageIds(EMailConnectionInfoExtended connectionInfoExtended)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfoExtended | connectionInfoExtended |
Returns
Type | Description |
---|---|
String[] |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEmailsAsString(EMailConnectionInfoExtended, String[])
Declaration
string[] GetEmailsAsString(EMailConnectionInfoExtended connectionInfoExtended, string[] messageIds)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfoExtended | connectionInfoExtended | |
String[] | messageIds |
Returns
Type | Description |
---|---|
String[] |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetEMailSOInfo(Int32)
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
EMailSOInfo GetEMailSOInfo(int eMailSOInfoId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | eMailSOInfoId | The identifier of the EMailSOInfo object |
Returns
Type | Description |
---|---|
EMailSOInfo | EMailSOInfo |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetExtendedEmailMessageIds(EMailConnectionInfoExtended)
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
string[] GetExtendedEmailMessageIds(EMailConnectionInfoExtended connectionInfoExtended)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfoExtended | connectionInfoExtended |
Returns
Type | Description |
---|---|
String[] |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetFolderEMailCount(EMailConnectionInfo, Boolean)
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
int GetFolderEMailCount(EMailConnectionInfo connectionInfo, bool onlyUnread)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
Boolean | onlyUnread | If true, only unread items are counted |
Returns
Type | Description |
---|---|
Int32 | Number of mail items |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetFolderHasNewEMail(EMailConnectionInfo)
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
bool GetFolderHasNewEMail(EMailConnectionInfo connectionInfo)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
Returns
Type | Description |
---|---|
Boolean | True if new mail is available. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetFolderInfo(EMailConnectionInfo, String[])
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
EMailFolder[] GetFolderInfo(EMailConnectionInfo connectionInfo, string[] folders)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
String[] | folders | Folders to get information about. |
Returns
Type | Description |
---|---|
EMailFolder[] | Folder information |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetFolderList(EMailConnectionInfo, Boolean)
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
string[] GetFolderList(EMailConnectionInfo connectionInfo, bool includeItemCount)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
Boolean | includeItemCount | If true, unread and total items are added to the foldername separated by a comma |
Returns
Type | Description |
---|---|
String[] | List of available folders as a string array |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetMailFromInReplyTo(String)
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
EMailEntity GetMailFromInReplyTo(string messageId)
Parameters
Type | Name | Description |
---|---|---|
String | messageId | The message id |
Returns
Type | Description |
---|---|
EMailEntity | EMailEntity that is in reply to the provided messageId |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetMailFromMessageId(String)
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
EMailEntity GetMailFromMessageId(string messageId)
Parameters
Type | Name | Description |
---|---|---|
String | messageId | The message id |
Returns
Type | Description |
---|---|
EMailEntity | EMailEntity with the provided message id |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetNewMail(Int32[])
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
EMailEnvelope[] GetNewMail(int[] folders)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | folders | List of folder ids to check for new email |
Returns
Type | Description |
---|---|
EMailEnvelope[] | The downloaded email envelopes |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetParticipantInfoFromEmailAddress(String, Int32)
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
Person GetParticipantInfoFromEmailAddress(string emailAddress, int appointmentId)
Parameters
Type | Name | Description |
---|---|---|
String | emailAddress | Email address of participant |
Int32 | appointmentId | Appointment id of participant |
Returns
Type | Description |
---|---|
Person | Person information |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetPersonEntitiesFromEmailAddress(String)
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
PersonEntity[] GetPersonEntitiesFromEmailAddress(string emailAddress)
Parameters
Type | Name | Description |
---|---|---|
String | emailAddress | The emailAddress to find persons and contacts for |
Returns
Type | Description |
---|---|
PersonEntity[] |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetPersonsFromEmailAddress(String)
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
Person[] GetPersonsFromEmailAddress(string emailAddress)
Parameters
Type | Name | Description |
---|---|---|
String | emailAddress | The emailAddress to find persons and contacts for |
Returns
Type | Description |
---|---|
Person[] |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetPreviewAttachmentFromDocId(Int32, String)
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
EMailAttachment GetPreviewAttachmentFromDocId(int docId, string attachmentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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 |
Returns
Type | Description |
---|---|
EMailAttachment | The attachment |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetPreviewAttachmentFromId(Int32, String, String, String)
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
EMailAttachment GetPreviewAttachmentFromId(int mailItemId, string attachmentId, string attachmentType, string attachmentFilename)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Returns
Type | Description |
---|---|
EMailAttachment | The attachment |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetReadySyncEmailAccounts()
Gets the list of SyncUserAccounts that should be synced.
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
SyncUserAccount[] GetReadySyncEmailAccounts()
Returns
Type | Description |
---|---|
SyncUserAccount[] | List of accounts to sync |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetUnsanitizedEMail(Int32, Boolean)
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
EMailEntity GetUnsanitizedEMail(int id, bool includeAttachments)
Parameters
Type | Name | Description |
---|---|---|
Int32 | id | The primary key of the email row in the DB |
Boolean | includeAttachments | Should we retrieve attachments embedded in the e-mail from the server |
Returns
Type | Description |
---|---|
EMailEntity | The e-mail |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetUnsanitizedEMailFromAttachmentId(Int32, String[], Boolean)
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
EMailEntity GetUnsanitizedEMailFromAttachmentId(int emailId, string[] attachmentIds, bool includeAttachments)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Boolean | includeAttachments | Should we retrieve attachments embedded in the e-mail from the server |
Returns
Type | Description |
---|---|
EMailEntity | The attachment as an e-mail |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetUnsanitizedEMailFromDocumentAttachmentId(Int32, String[], Boolean)
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
EMailEntity GetUnsanitizedEMailFromDocumentAttachmentId(int docId, string[] attachmentIds, bool includeAttachments)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Boolean | includeAttachments | Should we retrieve attachments embedded in the e-mail from the server |
Returns
Type | Description |
---|---|
EMailEntity | The attachment as an e-mail |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetUnsanitizedEMailFromDocumentId(Int32)
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
EMailEntity GetUnsanitizedEMailFromDocumentId(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | Unique id of the document |
Returns
Type | Description |
---|---|
EMailEntity | The e-mail |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetUnsanitizedEMailFromDocumentIdWithoutAttachmentStream(Int32)
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
EMailEntity GetUnsanitizedEMailFromDocumentIdWithoutAttachmentStream(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | Unique id of the document |
Returns
Type | Description |
---|---|
EMailEntity | The e-mail |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetUnsanitizedPreviewAttachmentFromDocId(Int32, String)
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
EMailAttachment GetUnsanitizedPreviewAttachmentFromDocId(int docId, string attachmentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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 |
Returns
Type | Description |
---|---|
EMailAttachment | The attachment |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
GetUnsanitizedPreviewAttachmentFromId(Int32, String, String, String)
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
EMailAttachment GetUnsanitizedPreviewAttachmentFromId(int mailItemId, string attachmentId, string attachmentType, string attachmentFilename)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Returns
Type | Description |
---|---|
EMailAttachment | The attachment |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
HasMXRecord(String)
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
bool HasMXRecord(string mailDomain)
Parameters
Type | Name | Description |
---|---|---|
String | mailDomain | The mail domain to check. Normally this is the part after @ in an email address |
Returns
Type | Description |
---|---|
Boolean | True if there is at least one MX record |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
HasNewMail(Int32, Int32)
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
bool HasNewMail(int mailItemId, int folderId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | mailItemId | The last known mailitemid |
Int32 | folderId | The folderId for the folder to check for new mail |
Returns
Type | Description |
---|---|
Boolean | Has new mail if true |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
HasSPFRecord(String, String)
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
bool HasSPFRecord(string sourceSpf, string targetDomain)
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 |
Returns
Type | Description |
---|---|
Boolean | True if a match is found |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
LatestItemIdByFolder(Int32)
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
int LatestItemIdByFolder(int folderId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | folderId | The folderId for the folder to check for the latest mail id |
Returns
Type | Description |
---|---|
Int32 | Mail Item id |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
MarkAsRead(EMailConnectionInfo, Int32[], Boolean)
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
void MarkAsRead(EMailConnectionInfo connectionInfo, int[] messageServerIds, bool read)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
Int32[] | messageServerIds | The e-mails to handle |
Boolean | read | If true mails are marked as read. If false mails are marked as unread. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
MarkEmailsAsRead(Int32[], Boolean)
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
void MarkEmailsAsRead(int[] ids, bool read)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | ids | The e-mails to handle |
Boolean | read | If true mails are marked as read. If false mails are marked as unread. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
MoveEmailsToFolder(Int32, Int32[])
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
void MoveEmailsToFolder(int folderId, int[] emailItemIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | folderId | The EmailFolderId of the folder to move to |
Int32[] | emailItemIds | The emails to move |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
MoveEmailsToTrash(Int32[])
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
void MoveEmailsToTrash(int[] ids)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | ids | The e-mails to handle |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
MoveToFolder(EMailConnectionInfo, Int32[], String)
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
void MoveToFolder(EMailConnectionInfo connectionInfo, int[] messageServerIds, string targetFolder)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
Int32[] | messageServerIds | The e-mails to handle |
String | targetFolder | Name of folder to move items to |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
RefreshFolder(EMailConnectionInfo, String[])
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
int RefreshFolder(EMailConnectionInfo connectionInfo, string[] folders)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | Email connection info credentials |
String[] | folders | List of folder names to refresh |
Returns
Type | Description |
---|---|
Int32 | Batch task id, or 0 if the processing was synchronous |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
RefreshFolderForAssociate(String[])
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
string RefreshFolderForAssociate(string[] folders)
Parameters
Type | Name | Description |
---|---|---|
String[] | folders | List of folder names to refresh |
Returns
Type | Description |
---|---|
String | JSON serialized string containing array of data about each folder |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
RelayMessage(EMailConnectionInfoExtended, String, String, String[])
Declaration
void RelayMessage(EMailConnectionInfoExtended connectionInfoExtended, string rfc822, string from, string[] recipients)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfoExtended | connectionInfoExtended | |
String | rfc822 | |
String | from | |
String[] | recipients |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
ResolveEMailRecipients(String)
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
EMailAddress[] ResolveEMailRecipients(string emailAddress)
Parameters
Type | Name | Description |
---|---|---|
String | emailAddress | The string to lookup emails from |
Returns
Type | Description |
---|---|
EMailAddress[] | Resolved EMail recipients |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
Save(EMailEntity)
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
EMailEntity Save(EMailEntity email)
Parameters
Type | Name | Description |
---|---|---|
EMailEntity | The e-mail to save |
Returns
Type | Description |
---|---|
EMailEntity | The updated saved entity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
SaveDraft(EMailEntity)
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
EMailEntity SaveDraft(EMailEntity entity)
Parameters
Type | Name | Description |
---|---|---|
EMailEntity | entity | The entity to save |
Returns
Type | Description |
---|---|
EMailEntity | The saved e-mail entity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
SaveEMail(EMailConnectionInfo, EMailEntity)
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
EMailEntity SaveEMail(EMailConnectionInfo connectionInfo, EMailEntity email)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
EMailEntity | The e-mail to save |
Returns
Type | Description |
---|---|
EMailEntity | The updated saved entity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
SaveEMailAccount(EMailAccount)
Updates the existing EMailAccount or creates a new EMailAccount if the id parameter is empty
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
EMailAccount SaveEMailAccount(EMailAccount eMailAccount)
Parameters
Type | Name | Description |
---|---|---|
EMailAccount | eMailAccount | The EMailAccount that is saved. |
Returns
Type | Description |
---|---|
EMailAccount | New or updated EMailAccount |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
SaveEmailToTmpDocument(EMailEntity, Int32, Boolean)
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
string SaveEmailToTmpDocument(EMailEntity email, int folderId, bool stripAttachments)
Parameters
Type | Name | Description |
---|---|---|
EMailEntity | The e-mail to save |
|
Int32 | folderId | The folder id where the email is |
Boolean | stripAttachments | If true, do not include attachments in tmp document |
Returns
Type | Description |
---|---|
String | Filename of the tmp document |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
SaveToMailServer(EMailEntity)
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
EMailEntity SaveToMailServer(EMailEntity email)
Parameters
Type | Name | Description |
---|---|---|
EMailEntity | The e-mail to save |
Returns
Type | Description |
---|---|
EMailEntity | The updated saved entity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
Send(EMailEntity[])
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
EMailEntity[] Send(EMailEntity[] emails)
Parameters
Type | Name | Description |
---|---|---|
EMailEntity[] | emails | The e-mails to send |
Returns
Type | Description |
---|---|
EMailEntity[] | The sent e-mails (updated with message id etc.) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
SendAndSaveEmailToTmpDocument(EMailEntity, Boolean)
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
string SendAndSaveEmailToTmpDocument(EMailEntity email, bool stripAttachments)
Parameters
Type | Name | Description |
---|---|---|
EMailEntity | The e-mail to send |
|
Boolean | stripAttachments | If true, do not include attachments in tmp document |
Returns
Type | Description |
---|---|
String | Filename of the tmp document |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
SendEMails(EMailConnectionInfo, EMailEntity[], EMailConnectionInfo)
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
EMailEntity[] SendEMails(EMailConnectionInfo outgoingConnectionInfo, EMailEntity[] emails, EMailConnectionInfo sentItemsConnectionInfo)
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. |
Returns
Type | Description |
---|---|
EMailEntity[] | The sent e-mails (updated with message id etc.) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
SetRepliedAt(String)
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
void SetRepliedAt(string messageId)
Parameters
Type | Name | Description |
---|---|---|
String | messageId | The MessageID |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
SetSubscription(EMailConnectionInfo, EMailFolder[])
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
void SetSubscription(EMailConnectionInfo connectionInfo, EMailFolder[] folders)
Parameters
Type | Name | Description |
---|---|---|
EMailConnectionInfo | connectionInfo | All information needed to connect to the mailserver |
EMailFolder[] | folders | Folders to set subscription value on |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
SyncEmailAccount(SyncUserAccount)
Sync the given account
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
void SyncEmailAccount(SyncUserAccount syncUserAccount)
Parameters
Type | Name | Description |
---|---|---|
SyncUserAccount | syncUserAccount | Account to sync |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
SyncEmailAccounts(SyncUserAccount[])
Start syncing of the given accounts
Online Restricted: The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
void SyncEmailAccounts(SyncUserAccount[] syncUserAccounts)
Parameters
Type | Name | Description |
---|---|---|
SyncUserAccount[] | syncUserAccounts | Accounts to sync |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
TestAuthenticate()
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
bool TestAuthenticate()
Returns
Type | Description |
---|---|
Boolean |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}
ToggleSubscription(Int32, Boolean)
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
void ToggleSubscription(int folderId, bool subscriptionStatus)
Parameters
Type | Name | Description |
---|---|---|
Int32 | folderId | The folder id to set subscription value on |
Boolean | subscriptionStatus | The subscription status to set |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (EMailAgent agent = new EMailAgent())
{
// call methods on agent here...
}
}