The following code uses the static Regex.IsMatch method to verify that a string is in valid e-mail format.
The IsValidEmail method returns true if the string contains a valid e-mail address and false if it does not, but takes no other action.
You can use IsValidEmail to filter out e-mail addresses containing invalid characters before your application stores the addresses in a database or displays them in an ASP.NET page.
bool IsValidEmail(string email)
{
return System.Text.RegularExpressions.Regex.IsMatch(email, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$");
}