Class OutgoingMailSession
Class to deal with sessions for outgoing (i.e. SMTP) mail servers.
Instantiate this class with BeginSend(string, string, string).
Implements
Inherited Members
Namespace: SuperOffice.CRM.Mail
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public sealed class OutgoingMailSession : MailSession<ISoOutgoingMailInterface>, IAsyncDisposable
Methods
SendEMailAsync(MailItem, CancellationToken)
Send the provided e-mail to the server
Declaration
public Task<MailItem> SendEMailAsync(MailItem email, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| MailItem | E-mail to send |
|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<MailItem> | The sent e-mail updated with messageid etc. |
ServerLoginAsync(string, string, string, bool, CancellationToken)
Log on to the mail server
Declaration
protected override Task<ISoOutgoingMailInterface> ServerLoginAsync(string server, string userName, string password, bool useSSL, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | server | Name of mail 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 |
| bool | useSSL | Use SSL |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<ISoOutgoingMailInterface> | Instance of interface to the mail plugin. |
Overrides
ServerLoginAsync(string, string, string, CancellationToken)
Log on to the mail server
Declaration
protected override Task<ISoOutgoingMailInterface> ServerLoginAsync(string server, string userName, string password, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | server | Name of mail 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 |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<ISoOutgoingMailInterface> | Instance of interface to the mail plugin. |
Overrides
ServerLogoutAsync()
Log out from the mail server.
Declaration
protected override Task ServerLogoutAsync()
Returns
| Type | Description |
|---|---|
| Task |