SmtpEmailProvider
Namespace: Proffer.Email.Smtp
A provider that sends email to a SMTP server with N:MailKit.
public class SmtpEmailProvider : Proffer.Email.IEmailProvider
Inheritance Object → SmtpEmailProvider
Implements IEmailProvider
Constructors
SmtpEmailProvider(IServiceProvider, IEmailProviderOptions)
Initializes a new instance of the SmtpEmailProvider class.
public SmtpEmailProvider(IServiceProvider serviceProvider, IEmailProviderOptions options)
Parameters
serviceProvider
IServiceProvider
The service provider.
options
IEmailProviderOptions
The options.
Exceptions
Methods
SendEmailAsync(IEmailAddress, IEnumerable<IEmailAddress>, String, String, String)
Sends an email.
public Task SendEmailAsync(IEmailAddress from, IEnumerable<IEmailAddress> recipients, string subject, string bodyText, string bodyHtml)
Parameters
from
IEmailAddress
The sender email address.
recipients
IEnumerable<IEmailAddress>
The email recipients.
subject
String
The subject.
bodyText
String
The body as plain text.
bodyHtml
String
The body as HTML.
Returns
A task that represents the asynchronous operation.
SendEmailAsync(IEmailAddress, IEnumerable<IEmailAddress>, String, String, String, IEnumerable<IEmailAttachment>)
Sends an email.
public Task SendEmailAsync(IEmailAddress from, IEnumerable<IEmailAddress> recipients, string subject, string bodyText, string bodyHtml, IEnumerable<IEmailAttachment> attachments)
Parameters
from
IEmailAddress
The sender email address.
recipients
IEnumerable<IEmailAddress>
The email recipients.
subject
String
The subject.
bodyText
String
The body as plain text.
bodyHtml
String
The body as HTML.
attachments
IEnumerable<IEmailAttachment>
The file attachments.
Returns
A task that represents the asynchronous operation.
SendEmailAsync(IEmailAddress, IEnumerable<IEmailAddress>, IEnumerable<IEmailAddress>, IEnumerable<IEmailAddress>, String, String, String, IEnumerable<IEmailAttachment>, IEmailAddress)
Sends an email.
public Task SendEmailAsync(IEmailAddress from, IEnumerable<IEmailAddress> recipients, IEnumerable<IEmailAddress> ccRecipients, IEnumerable<IEmailAddress> bccRecipients, string subject, string bodyText, string bodyHtml, IEnumerable<IEmailAttachment> attachments, IEmailAddress replyTo)
Parameters
from
IEmailAddress
The sender email address.
recipients
IEnumerable<IEmailAddress>
The email recipients.
ccRecipients
IEnumerable<IEmailAddress>
The CC email recipients.
bccRecipients
IEnumerable<IEmailAddress>
The BCC email recipients.
subject
String
The subject.
bodyText
String
The body as plain text.
bodyHtml
String
The body as HTML.
attachments
IEnumerable<IEmailAttachment>
The file attachments.
replyTo
IEmailAddress
The reply-to email address.