Class MailKitEmailAddress
A mail kit email address.
Inheritance
Implements
Inherited Members
Namespace: Kephas.Mail.Message
Assembly: Kephas.Mail.MailKit.dll
Syntax
public class MailKitEmailAddress : MailboxAddress, IComparable<InternetAddress>, IEquatable<InternetAddress>, IEmailAddress, IIndexable
Constructors
| Improve this Doc View SourceMailKitEmailAddress(IEnumerable<String>, String)
Initializes a new instance of the MailKitEmailAddress class.
Declaration
public MailKitEmailAddress(IEnumerable<string> route, string address)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | route | The route of the mailbox. |
System.String | address | The address of the mailbox. |
Remarks
Creates a new MailKitEmailAddress with the specified address and route.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
-or-
|
MimeKit.ParseException |
|
MailKitEmailAddress(String)
Initializes a new instance of the MailKitEmailAddress class.
Declaration
public MailKitEmailAddress(string address)
Parameters
Type | Name | Description |
---|---|---|
System.String | address | The address of the mailbox. |
Remarks
Creates a new MailKitEmailAddress with the specified address.
note
The address
must be in the form user@example.com
.
This method cannot be used to parse a free-form email address that includes the name or encloses the address in angle brackets.
To parse a free-form email address, use MimeKit.MailboxAddress.Parse(System.String) instead.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
MimeKit.ParseException |
|
MailKitEmailAddress(String, IEnumerable<String>, String)
Initializes a new instance of the MailKitEmailAddress class.
Declaration
public MailKitEmailAddress(string name, IEnumerable<string> route, string address)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the mailbox. |
System.Collections.Generic.IEnumerable<System.String> | route | The route of the mailbox. |
System.String | address | The address of the mailbox. |
Remarks
Creates a new MailKitEmailAddress with the specified name, address and route.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
-or-
|
MimeKit.ParseException |
|
MailKitEmailAddress(String, String)
Initializes a new instance of the MailKitEmailAddress class.
Declaration
public MailKitEmailAddress(string name, string address)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the mailbox. |
System.String | address | The address of the mailbox. |
Remarks
Creates a new MailKitEmailAddress with the specified name and address.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
MimeKit.ParseException |
|
MailKitEmailAddress(Encoding, String, IEnumerable<String>, String)
Initializes a new instance of the MailKitEmailAddress class.
Declaration
public MailKitEmailAddress(Encoding encoding, string name, IEnumerable<string> route, string address)
Parameters
Type | Name | Description |
---|---|---|
System.Text.Encoding | encoding | The character encoding to be used for encoding the name. |
System.String | name | The name of the mailbox. |
System.Collections.Generic.IEnumerable<System.String> | route | The route of the mailbox. |
System.String | address | The address of the mailbox. |
Remarks
Creates a new MailKitEmailAddress with the specified name, address and route. The specified text encoding is used when encoding the name according to the rules of rfc2047.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
-or-
-or-
|
MimeKit.ParseException |
|
MailKitEmailAddress(Encoding, String, String)
Initializes a new instance of the MailKitEmailAddress class.
Declaration
public MailKitEmailAddress(Encoding encoding, string name, string address)
Parameters
Type | Name | Description |
---|---|---|
System.Text.Encoding | encoding | The character encoding to be used for encoding the name. |
System.String | name | The name of the mailbox. |
System.String | address | The address of the mailbox. |
Remarks
Creates a new MailKitEmailAddress with the specified name and address. The specified text encoding is used when encoding the name according to the rules of rfc2047.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
-or-
|
MimeKit.ParseException |
|
Properties
| Improve this Doc View SourceItem[String]
Convenience method that provides a string Indexer to the Properties collection AND the strongly typed properties of the object by name. // dynamic exp["Address"] = "112 nowhere lane"; // strong var name = exp["StronglyTypedProperty"] as string;.
Declaration
public object this[string key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Property Value
Type | Description |
---|---|
System.Object | The System.Object identified by the key. |
Explicit Interface Implementations
| Improve this Doc View SourceIEmailAddress.DisplayName
Gets the display name of the subject associated to the address.
Declaration
string IEmailAddress.DisplayName { get; }
Returns
Type | Description |
---|---|
System.String |