In reading about what would be the best way to validate a mail address via regular expressions, I came across with an attempt to validate with
try
{
new MailAddress(input);
}
catch (Exception ex)
{
// invalid
}
What method does the MailAddress class use to ensure a mail address is valid?
If you mean by validate whether or not it’s a valid e-mail address format, it supports several standard formats:
The MailAddress class supports the following mail address formats:
.
This is from MailAddress Class
As for what method it uses to validate the formats, I don’t know. You could always try Reflector to see what it’s doing internally. Is there a particular reason you want to know the internal details?