Class SoMail
Helper class for sending and receiving e-mails
Namespace: SuperOffice.CRM.Mail
Assembly: SoDataBase.dll
Syntax
public static class SoMail : Object
Properties
CanRead
Get if the currently logged in user can read e-mails and access the message store.
Declaration
public static bool CanRead { get; }
Property Value
Type | Description |
---|---|
Boolean |
CanSend
Get if the currently logged in user can send e-mails
Declaration
public static bool CanSend { get; }
Property Value
Type | Description |
---|---|
Boolean |
MailReader
Helper class for sending and receiving e-mails
Declaration
public static ISoIncomingMailInterface MailReader { get; }
Property Value
Type | Description |
---|---|
ISoIncomingMailInterface |
MailSender
Helper class for sending and receiving e-mails
Declaration
public static ISoOutgoingMailInterface MailSender { get; }
Property Value
Type | Description |
---|---|
ISoOutgoingMailInterface |
Methods
BeginRead(SoMailFolder)
Obtain reference to session for incoming mail server/message store (i.e. IMAP).
Declaration
public static MessageStoreSession BeginRead(SoMailFolder folder)
Parameters
Type | Name | Description |
---|---|---|
SoMailFolder | folder | Folder to set active |
Returns
Type | Description |
---|---|
MessageStoreSession | Disposable object holding session to incoming mail server/message store (i.e. IMAP). |
BeginRead(SoMailFolder, String, String, String)
Obtain reference to session for incoming mail server/message store (i.e. IMAP).
Declaration
public static MessageStoreSession BeginRead(SoMailFolder folder, string server, string userName, string password)
Parameters
Type | Name | Description |
---|---|---|
SoMailFolder | folder | Folder to set active |
String | server | Name of outgoing (i.e. SMTP) server with optional port. |
String | userName | User name used to authenticate to the mail server |
String | password | Password used to authenticate to the mail server |
Returns
Type | Description |
---|---|
MessageStoreSession | Disposable object holding session to incoming mail server/message store (i.e. IMAP). |
BeginRead(SoMailFolder, String, String, String, Boolean)
Obtain reference to session for incoming mail server/message store (i.e. IMAP).
Declaration
public static MessageStoreSession BeginRead(SoMailFolder folder, string server, string userName, string password, bool useSSL)
Parameters
Type | Name | Description |
---|---|---|
SoMailFolder | folder | Folder to set active |
String | server | Name of outgoing (i.e. SMTP) server with optional port. |
String | userName | User name used to authenticate to the mail server |
String | password | Password used to authenticate to the mail server |
Boolean | useSSL | Use SSL |
Returns
Type | Description |
---|---|
MessageStoreSession | Disposable object holding session to incoming mail server/message store (i.e. IMAP). |
BeginRead(String, String, String, String)
Obtain reference to session for incoming mail server/message store (i.e. IMAP).
Declaration
public static MessageStoreSession BeginRead(string folderName, string server, string userName, string password)
Parameters
Type | Name | Description |
---|---|---|
String | folderName | Full path and name of folder to set active |
String | server | Name of outgoing (i.e. SMTP) server with optional port. |
String | userName | User name used to authenticate to the mail server |
String | password | Password used to authenticate to the mail server |
Returns
Type | Description |
---|---|
MessageStoreSession | Disposable object holding session to incoming mail server/message store (i.e. IMAP). |
BeginRead(String, String, String, String, Boolean)
Obtain reference to session for incoming mail server/message store (i.e. IMAP).
Declaration
public static MessageStoreSession BeginRead(string folderName, string server, string userName, string password, bool useSSL)
Parameters
Type | Name | Description |
---|---|---|
String | folderName | Full path and name of folder to set active |
String | server | Name of outgoing (i.e. SMTP) server with optional port. |
String | userName | User name used to authenticate to the mail server |
String | password | Password used to authenticate to the mail server |
Boolean | useSSL |
Returns
Type | Description |
---|---|
MessageStoreSession | Disposable object holding session to incoming mail server/message store (i.e. IMAP). |
BeginRead(String, String, String, String, Boolean, Boolean)
Obtain reference to session for incoming mail server/message store (i.e. IMAP).
Declaration
public static MessageStoreSession BeginRead(string folderName, string server, string userName, string password, bool useSSL, bool readOnly)
Parameters
Type | Name | Description |
---|---|---|
String | folderName | Full path and name of folder to set active |
String | server | Name of outgoing (i.e. SMTP) server with optional port. |
String | userName | User name used to authenticate to the mail server |
String | password | Password used to authenticate to the mail server |
Boolean | useSSL | |
Boolean | readOnly | Should folder be selected as readonly |
Returns
Type | Description |
---|---|
MessageStoreSession | Disposable object holding session to incoming mail server/message store (i.e. IMAP). |
BeginSend()
Obtain reference to session for outgoing (i.e. SMTP) mail server according to the current users configuration.
Declaration
public static OutgoingMailSession BeginSend()
Returns
Type | Description |
---|---|
OutgoingMailSession | Disposable object holding session to outgoing (i.e. SMTP) mail server. |
BeginSend(String, String, String)
Obtain reference to session for outgoing (i.e. SMTP) mail server.
Declaration
public static OutgoingMailSession BeginSend(string server, string userName, string password)
Parameters
Type | Name | Description |
---|---|---|
String | server | Name of outgoing (i.e. SMTP) server with optional port. |
String | userName | User name used to authenticate to the mail server |
String | password | Password used to authenticate to the mail server |
Returns
Type | Description |
---|---|
OutgoingMailSession | Disposable object holding session to outgoing (i.e. SMTP) mail server. |
BeginSend(String, String, String, Boolean)
Obtain reference to session for outgoing (i.e. SMTP) mail server.
Declaration
public static OutgoingMailSession BeginSend(string server, string userName, string password, bool useSSL)
Parameters
Type | Name | Description |
---|---|---|
String | server | Name of outgoing (i.e. SMTP) server with optional port. |
String | userName | User name used to authenticate to the mail server |
String | password | Password used to authenticate to the mail server |
Boolean | useSSL | Should we use a secure connection |
Returns
Type | Description |
---|---|
OutgoingMailSession | Disposable object holding session to outgoing (i.e. SMTP) mail server. |
GetFolderName(SoMailFolder)
Get folder name from SuperOffice.CRM.Mail.SoMailFolder
Declaration
public static string GetFolderName(SoMailFolder folder)
Parameters
Type | Name | Description |
---|---|---|
SoMailFolder | folder | Folder to find name for. |
Returns
Type | Description |
---|---|
String | Name of folder. |
GetLoginCredentials(Int32, String)
Get login info for specified type. Ex: "imap", "smtp" for a specified associate
Declaration
public static SoMailCredentials GetLoginCredentials(int associateId, string type)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | |
String | type |
Returns
Type | Description |
---|---|
SoMailCredentials |
GetLoginCredentials(String)
Get login info for specified type. Ex: "imap", "smtp".
Declaration
public static SoMailCredentials GetLoginCredentials(string type)
Parameters
Type | Name | Description |
---|---|---|
String | type |
Returns
Type | Description |
---|---|
SoMailCredentials |
LoginIncoming(String, String, String, Boolean, String, Boolean, Boolean)
Log in to an incoming mail server
Declaration
public static ISoIncomingMailInterface LoginIncoming(string server, string username, string password, bool useSSL, string folder, bool readOnly, bool createFolderIfNotFound)
Parameters
Type | Name | Description |
---|---|---|
String | server | DNS or IP to mailserver. Port may be appended by suffixing with ':port' |
String | username | Account username |
String | password | Account password |
Boolean | useSSL | Use secure connection |
String | folder | Name of folder to set as active |
Boolean | readOnly | Should folder be selected as read only |
Boolean | createFolderIfNotFound | Create the folder if it does not exist |
Returns
Type | Description |
---|---|
ISoIncomingMailInterface | Instance of the created mail connection |
LoginIncomingExtended(String, String, Int32, String, String, String, Boolean, Boolean)
Log in to an incoming mail server
Declaration
public static ISoIncomingMailInterface LoginIncomingExtended(string protocol, string server, int port, string username, string password, string folder, bool readOnly, bool createFolderIfNotFound)
Parameters
Type | Name | Description |
---|---|---|
String | protocol | |
String | server | DNS or IP to mailserver. Port may be appended by suffixing with ':port' |
Int32 | port | |
String | username | Account username |
String | password | Account password |
String | folder | Name of folder to set as active |
Boolean | readOnly | Should folder be selected as read only |
Boolean | createFolderIfNotFound | Create the folder if it does not exist |
Returns
Type | Description |
---|---|
ISoIncomingMailInterface | Instance of the created mail connection |
LoginOutgoing(String, String, String, Boolean)
Log in to an outgoing mail server
Declaration
public static ISoOutgoingMailInterface LoginOutgoing(string server, string username, string password, bool useSSL)
Parameters
Type | Name | Description |
---|---|---|
String | server | DNS or IP to mailserver. Port may be appended by suffixing with ':port' |
String | username | Account username |
String | password | Account password |
Boolean | useSSL | Use secure connection |
Returns
Type | Description |
---|---|
ISoOutgoingMailInterface | Instance of the created mail connection |
LoginOutgoingExtended(String, String, Int32, String, String)
Log in to an outgoing mail server
Declaration
public static ISoOutgoingMailInterface LoginOutgoingExtended(string protocol, string server, int port, string username, string password)
Parameters
Type | Name | Description |
---|---|---|
String | protocol | |
String | server | DNS or IP to mailserver. Port may be appended by suffixing with ':port' |
Int32 | port | |
String | username | Account username |
String | password | Account password |
Returns
Type | Description |
---|---|
ISoOutgoingMailInterface | Instance of the created mail connection |