PeterO.Mail.Address
## PeterO.Mail.Address
public class Address
Represents an email address.
Member Summary
[Domain](#Domain)
- Gets the domain of this email address (the part after the “@” sign).[Equals(object)](#Equals_object)
- Determines whether this object and another object are equal.[GetHashCode()](#GetHashCode)
- Returns a hash code for this address object.[LocalPart](#LocalPart)
- Gets the local part of this email address (the part before the “@” sign).[ToString()](#ToString)
- Converts this address object to a text string.
public Address( string addressValue);
Initializes a new instance of the PeterO.Mail.Address class.
Parameters:
- addressValue: An email address. This parameter must contain an at-sign, and may not contain extraneous whitespace, and comments enclosed in parentheses are also not allowed.
Exceptions:
-
System.ArgumentNullException: The parameter addressValue is null.
-
System.ArgumentException: AddressValue is empty.; Address doesn’t contain a ‘@’sign; Invalid local part; Expected ‘@’sign after local part; Expected domain after ‘@’; Invalid domain; Address too long.
public string Domain { get; }
Gets the domain of this email address (the part after the “@” sign).
Returns:
The domain of this email address (the part after the “@” sign).
public string LocalPart { get; }
Gets the local part of this email address (the part before the “@” sign).
Returns:
The local part of this email address (the part before the “@” sign).
public override bool Equals( object obj);
Determines whether this object and another object are equal.
Parameters:
- obj: The parameter obj is an arbitrary object.
Return Value:
true
if this object and another object are equal; otherwise, false
.
public override int GetHashCode();
Returns a hash code for this address object. No application or process identifiers are used in the hash code calculation.
Return Value:
A hash code for this instance.
public override string ToString();
Converts this address object to a text string.
Return Value:
A string representation of this object.