Validate Email
Validate email id
Source
public static class Extensions
{
public static bool IsValidEmailAddress(this string s)
{
Regex regex = new Regex(@"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$");
return regex.IsMatch(s);
}
}
Example
string customerEmailAddress = "test@test.com";
customerEmailAddress.IsValidEmailAddress()