Class EMailAgent
Facade 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
public class EMailAgent : AgentBase<IEMailAgent>, IDisposable, 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...
}
}
Constructors
EMailAgent()
Facade 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.Declaration
public EMailAgent()
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)
Facade 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.Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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[])
Facade 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.Declaration
public 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
Declaration
public 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
Declaration
public 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)
Declaration
public 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)
Facade 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.Declaration
public 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)
Facade 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.Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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.
Declaration
public 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).
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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.
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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)
Facade 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.Declaration
public 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)
Facade 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.Declaration
public 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[])
Facade 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.Declaration
public 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.
Declaration
public 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().
Declaration
public 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
Declaration
public 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.
Declaration
public 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.
Declaration
public 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.
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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.
Declaration
public 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.
Declaration
public 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.
Declaration
public 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.
Declaration
public 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.
Declaration
public 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.
Declaration
public 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.
Declaration
public 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.
Declaration
public 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.
Declaration
public 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.
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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.
Declaration
public 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
Declaration
public 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[])
Facade 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.Declaration
public 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.
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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
Declaration
public 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...
}
}