PeterO.Mail.Address
PeterO.Mail.Address
public class Address
Represents an email address.
Member Summary
Domain
- Gets the domain of this email address (the part after the "@" sign).Equals(object)
- Determines whether this object and another object are equal.GetHashCode()
- Returns a hash code for this address object.LocalPart
- Gets the local part of this email address (the part before the "@" sign).ToString()
- Converts this address object to a text string.
Address Constructor
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.
Domain
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).
LocalPart
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).
Equals
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
.
GetHashCode
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.
ToString
public override string ToString();
Converts this address object to a text string.
Return Value:
A string representation of this object.