Class MailKitEmailMessageBuilder
A mail kit email message builder.
Inheritance
Implements
Inherited Members
Namespace: Kephas.Mail.Services
Assembly: Kephas.Mail.MailKit.dll
Syntax
public class MailKitEmailMessageBuilder : IEmailMessageBuilder
Constructors
| Improve this Doc View SourceMailKitEmailMessageBuilder()
Initializes a new instance of the MailKitEmailMessageBuilder class.
Declaration
public MailKitEmailMessageBuilder()
Properties
| Improve this Doc View SourceEmailMessage
Gets the email message.
Declaration
public IEmailMessage EmailMessage { get; }
Property Value
Type | Description |
---|---|
IEmailMessage | The email message. |
Methods
| Improve this Doc View SourceAddAttachment(Stream, String)
Adds an attachment to the message.
Declaration
public IEmailMessageBuilder AddAttachment(Stream content, string name)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | content | The attachment content. |
System.String | name | The attachment name. |
Returns
Type | Description |
---|---|
IEmailMessageBuilder | This IEmailMessageBuilder. |
Bcc(String, String)
Sets the blind carbon copy recipient address.
Declaration
public IEmailMessageBuilder Bcc(string address, string displayName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | address | The address. |
System.String | displayName | Name to display. |
Returns
Type | Description |
---|---|
IEmailMessageBuilder | This IEmailMessageBuilder. |
BodyHtml(String)
Sets the HTML body.
Declaration
public IEmailMessageBuilder BodyHtml(string body)
Parameters
Type | Name | Description |
---|---|---|
System.String | body | The HTML body. |
Returns
Type | Description |
---|---|
IEmailMessageBuilder | This IEmailMessageBuilder. |
BodyText(String)
Sets the text body.
Declaration
public IEmailMessageBuilder BodyText(string body)
Parameters
Type | Name | Description |
---|---|---|
System.String | body | The text body. |
Returns
Type | Description |
---|---|
IEmailMessageBuilder | This IEmailMessageBuilder. |
Cc(String, String)
Sets the carbon copy recipient address.
Declaration
public IEmailMessageBuilder Cc(string address, string displayName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | address | The address. |
System.String | displayName | Name to display. |
Returns
Type | Description |
---|---|
IEmailMessageBuilder | This IEmailMessageBuilder. |
From(String, String)
Sets the 'on behalf' recipient address.
Declaration
public IEmailMessageBuilder From(string address, string displayName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | address | The address. |
System.String | displayName | Name to display. |
Returns
Type | Description |
---|---|
IEmailMessageBuilder | This IEmailMessageBuilder. |
Sender(String, String)
Sets the sender address.
Declaration
public IEmailMessageBuilder Sender(string address, string displayName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | address | The address. |
System.String | displayName | Name to display. |
Returns
Type | Description |
---|---|
IEmailMessageBuilder | This IEmailMessageBuilder. |
Subject(String)
Sets the subject.
Declaration
public IEmailMessageBuilder Subject(string subject)
Parameters
Type | Name | Description |
---|---|---|
System.String | subject | The subject. |
Returns
Type | Description |
---|---|
IEmailMessageBuilder | This IEmailMessageBuilder. |
To(String, String)
Sets the recipient address.
Declaration
public IEmailMessageBuilder To(string address, string displayName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | address | The address. |
System.String | displayName | Name to display. |
Returns
Type | Description |
---|---|
IEmailMessageBuilder | This IEmailMessageBuilder. |