Mailbox Address Class
A mailbox address, as specified by rfc822.
Definition
Namespace: MimeKit
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public class MailboxAddress : InternetAddress- Inheritance
- Object InternetAddress MailboxAddress
- Derived
Remarks
Represents a mailbox address (commonly referred to as an email address)
for a single recipient.
Example
C#
public static void ParseMailbox ()
{
// Parse() throws a ParseException if the text is not a valid mailbox address.
var mailbox = MailboxAddress.Parse ("\"Bing, Chandler\" <chandler@friends.com>");
Console.WriteLine ("Name: {0}", mailbox.Name); // Bing, Chandler
Console.WriteLine ("Address: {0}", mailbox.Address); // chandler@friends.com
Console.WriteLine ("LocalPart: {0}", mailbox.LocalPart); // chandler
Console.WriteLine ("Domain: {0}", mailbox.Domain); // friends.com
// ToString() quotes the name if needed. Passing true for the encode argument also
// rfc2047-encodes any non-ASCII characters, making the result suitable for use in
// a message header.
Console.WriteLine (mailbox.ToString (true)); // "Bing, Chandler" <chandler@friends.com>
}
Constructors
| MailboxAddress(String, String) | Initialize a new instance of the MailboxAddress class. |
| MailboxAddress(Encoding, String, String) | Initialize a new instance of the MailboxAddress class. |
| MailboxAddress(String, IEnumerableString, String) | Initialize a new instance of the MailboxAddress class. |
| MailboxAddress(Encoding, String, IEnumerableString, String) | Initialize a new instance of the MailboxAddress class. |
Properties
| Address | Get or set the mailbox address. |
| Domain | Get the domain of the email address. |
| Encoding |
Get or set the character encoding to use when encoding the name of the address.
(Inherited from InternetAddress) |
| IdnMapping | Get or set the punycode implementation that should be used for encoding and decoding mailbox addresses. |
| IsInternational | Get whether the address is an international address. |
| LocalPart | Get the local-part of the email address. |
| Name |
Get or set the display name of the address.
(Inherited from InternetAddress) |
| Route | Get the mailbox route. |
Methods
| Clone |
Clone the mailbox address.
(Overrides InternetAddressClone) |
| CompareTo |
Compares two internet addresses.
(Inherited from InternetAddress) |
| DecodeAddrspec | Decode an addrspec token according to IDN decoding rules. |
| EncodeAddrspec | Encode an addrspec token according to IDN encoding rules. |
| Equals(InternetAddress) |
Determine whether the specified MailboxAddress is equal to the current MailboxAddress.
(Overrides InternetAddressEquals(InternetAddress)) |
| Equals(Object) |
Determine whether the specified object is equal to the current object.
(Inherited from InternetAddress) |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
| GetAddress | Get the mailbox address, either IDN-encoded or decoded. |
| GetDomain | Get the domain of the email address, either IDN-encoded or decoded. |
| GetHashCode |
Return the hash code for this instance.
(Inherited from InternetAddress) |
| GetType | Gets the Type of the current instance. (Inherited from Object) |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) |
| OnChanged |
Raise the internal changed event used by MimeMessage to keep headers in sync.
(Inherited from InternetAddress) |
| Parse(Byte) | Parse the given input buffer into a new MailboxAddress instance. |
| Parse(String) | Parse the given text into a new MailboxAddress instance. |
| Parse(Byte, Int32) | Parse the given input buffer into a new MailboxAddress instance. |
| Parse(ParserOptions, Byte) | Parse the given input buffer into a new MailboxAddress instance. |
| Parse(ParserOptions, String) | Parse the given text into a new MailboxAddress instance. |
| Parse(Byte, Int32, Int32) | Parse the given input buffer into a new MailboxAddress instance. |
| Parse(ParserOptions, Byte, Int32) | Parse the given input buffer into a new MailboxAddress instance. |
| Parse(ParserOptions, Byte, Int32, Int32) | Parse the given input buffer into a new MailboxAddress instance. |
| ToString |
Serialize an InternetAddress to a string suitable for display.
(Inherited from InternetAddress) |
| ToString(Boolean) |
Serialize an InternetAddress to a string, optionally encoding it for transport.
(Inherited from InternetAddress) |
| ToString(FormatOptions, Boolean) |
Return a string representation of the MailboxAddress,
optionally encoding it for transport.
(Overrides InternetAddressToString(FormatOptions, Boolean)) |
| TryParse(Byte, MailboxAddress) | Try to parse the given input buffer into a new MailboxAddress instance. |
| TryParse(String, MailboxAddress) | Try to parse the given text into a new MailboxAddress instance. |
| TryParse(Byte, Int32, MailboxAddress) | Try to parse the given input buffer into a new MailboxAddress instance. |
| TryParse(ParserOptions, Byte, MailboxAddress) | Try to parse the given input buffer into a new MailboxAddress instance. |
| TryParse(ParserOptions, String, MailboxAddress) | Try to parse the given text into a new MailboxAddress instance. |
| TryParse(Byte, Int32, Int32, MailboxAddress) | Try to parse the given input buffer into a new MailboxAddress instance. |
| TryParse(ParserOptions, Byte, Int32, MailboxAddress) | Try to parse the given input buffer into a new MailboxAddress instance. |
| TryParse(ParserOptions, Byte, Int32, Int32, MailboxAddress) | Try to parse the given input buffer into a new MailboxAddress instance. |
Operators
| (MailAddress to MailboxAddress) | Explicit cast to convert a MailAddress to a MailboxAddress. |
| (MailboxAddress to MailAddress) | Explicit cast to convert a MailboxAddress to a MailAddress. |