email property c# code example
Example 1: check if string is email c#
bool IsValidEmail(string email)
{
try {
var addr = new System.Net.Mail.MailAddress(email);
return addr.Address == email;
}
catch {
return false;
}
}
Example 2: email object c#
new MailAddress("[email protected]")