Namespace: System.Net.Mail
MailAddress
Represents the address of an electronic mail sender or recipient.
Properties (4)
String Address
Gets the email address specified when this instance was created.
Value: A String that contains the email address.
String DisplayName
Gets the display name composed from the display name and address information specified when this instance was created.
Value: A String that contains the display name; otherwise, Empty ("") if no display name information was specified when this instance was created.
String Host
Gets the host portion of the address specified when this instance was created.
Value: A String that contains the name of the host computer that accepts email for the User property.
String User
Gets the user information from the address specified when this instance was created.
Value: A String that contains the user name portion of the Address.
Methods (3)
MailAddress(String)Constructor
Initializes a new instance of the MailAddress class using the specified address.
| Parameter | Description |
|---|---|
| address | A String that contains an email address. |
MailAddress(String,String)Constructor
Initializes a new instance of the MailAddress class using the specified address and display name.
| Parameter | Description |
|---|---|
| address | A String that contains an email address. |
| displayName | A String that contains the display name associated with address. This parameter can be null. |
String ToString
Returns a string representation of this instance.
Returns: A String that contains the contents of this MailAddress.