Class MailKitEmailSenderServiceBase
A MailKit email sender service.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Mail.Services
Assembly: Kephas.Mail.MailKit.dll
Syntax
public abstract class MailKitEmailSenderServiceBase : Loggable, ILoggable, IEmailSenderService
Methods
| Improve this Doc View SourceCreateEmailMessageBuilder(IContext)
Creates email message builder.
Declaration
public IEmailMessageBuilder CreateEmailMessageBuilder(IContext context = null)
Parameters
Type | Name | Description |
---|---|---|
IContext | context | The sending context. |
Returns
Type | Description |
---|---|
IEmailMessageBuilder | The new email message builder. |
GetConnectionData(IContext)
Gets the connection data.
Declaration
protected virtual (ICredentials credentials, string host, int port)GetConnectionData(IContext context)
Parameters
Type | Name | Description |
---|---|---|
IContext | context | The sending context. |
Returns
Type | Description |
---|---|
System.ValueTuple<System.Net.ICredentials, System.String, System.Int32> | The connection data. |
GetEmailSenderSettings()
Gets the email sender settings.
Declaration
protected abstract SmtpSettings GetEmailSenderSettings()
Returns
Type | Description |
---|---|
SmtpSettings | The email sender settings. |
GetNormalizedMailMessage(IEmailMessage)
Gets normalized mail message.
Declaration
protected virtual MimeMessage GetNormalizedMailMessage(IEmailMessage emailMessage)
Parameters
Type | Name | Description |
---|---|---|
IEmailMessage | emailMessage | The email message. |
Returns
Type | Description |
---|---|
MimeKit.MimeMessage | The normalized mail message. |
GetSmtpClientAsync(IContext, CancellationToken)
Creates SMTP client.
Declaration
protected virtual Task<SmtpClient> GetSmtpClientAsync(IContext context, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IContext | context | The sending context. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<MailKit.Net.Smtp.SmtpClient> | The new SMTP client as promise. |
SendAsync(IEmailMessage, IContext, CancellationToken)
Sends an email asynchronously.
Declaration
public Task SendAsync(IEmailMessage emailMessage, IContext context = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IEmailMessage | emailMessage | The email message. |
IContext | context | The sending context. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | An asynchronous result. |