Show / Hide Table of Contents

Class DefaultEmailSender

A default email service that uses SMTP to send emails.

Inheritance
Object
DefaultEmailSender
Inherited Members
System.Object.ToString()
Object.Equals(Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
Object.MemberwiseClone()
Namespace: IRM.Mail
Assembly: IRM.dll
Syntax
public class DefaultEmailSender : IEmailSender

Constructors

DefaultEmailSender(EmailOptions)

Creates a new instance of DefaultEmailSender.

Declaration
public DefaultEmailSender(EmailOptions options)
Parameters
EmailOptions options

The EmailOptions.

Properties

Options

Gets the EmailOptions.

Declaration
protected EmailOptions Options { get; }
Property Value
EmailOptions

Methods

CreateMailMessage(IEnumerable<EmailAddress>, String, String, String, IEnumerable<FileAttachment>, IEnumerable<EmailAddress>, Action<MailMessage>)

Creates a MailMessage from the supplied parameters and configured options.

Declaration
protected MailMessage CreateMailMessage(IEnumerable<EmailAddress> receivers, string subject, string message, string htmlMessage = null, IEnumerable<FileAttachment> attachments = null, IEnumerable<EmailAddress> cc = null, Action<MailMessage> createMailMessageCallback = null)
Parameters
IEnumerable<EmailAddress> receivers

A collection of e-mail addresses that should receive the e-mail.

String subject

The subject line for the e-mail.

String message

The text formated body of the e-mail.

String htmlMessage

The html formated body of the e-mail.

IEnumerable<FileAttachment> attachments

A collection of attachements to be send with the e-mail.

IEnumerable<EmailAddress> cc

A collection of e.mail addresses that should get a copy of the e-mail.

System.Action<MailMessage> createMailMessageCallback

A callback where caller can set additional MailMessage properties.

Returns
MailMessage

A MailMessage created from the supplied parameters and configured options.

SendEmailAsync(IEnumerable<EmailAddress>, String, String, String, IEnumerable<FileAttachment>, IEnumerable<EmailAddress>, Action<Object>)

Sends an e-mail message to one or more receivers.

Declaration
public async Task SendEmailAsync(IEnumerable<EmailAddress> receivers, string subject, string message, string htmlMessage = null, IEnumerable<FileAttachment> attachments = null, IEnumerable<EmailAddress> cc = null, Action<object> createMailMessageCallback = null)
Parameters
IEnumerable<EmailAddress> receivers

A collection of e-mail addresses that should receive the e-mail.

String subject

The subject of the email.

String message

The e-mail message as simle text (body).

String htmlMessage

The e-mail message as html (body).

IEnumerable<FileAttachment> attachments

A collection of attachments to be included with the e-mail message.

IEnumerable<EmailAddress> cc

A collection of e.mail addresses that should get a copy of the e-mail.

System.Action<Object> createMailMessageCallback

A callback where caller can set additional MailMessage properties.

Returns
System.Threading.Tasks.Task

The task object representing the asynchronous operation.

Implements
IEmailSender.SendEmailAsync(IEnumerable<EmailAddress>, String, String, String, IEnumerable<FileAttachment>, IEnumerable<EmailAddress>, Action<Object>)

Extension Methods

ObjectExtensions.DeepClone<T>(T)
EmailSenderExtensions.SendEmailAsync(IEmailSender, EmailAddress, String, String, String, IEnumerable<FileAttachment>, IEnumerable<EmailAddress>, Action<Object>)
AnnotationsExtensions.IsValid(Object)
Back to top Generated by DocFX