Here is function to check email is in proper format or not, email is valid or not.
public bool CheckEmail(string Email_Address)
{
string pattern = @"^[a-z][a-z|0-9|]*([_][a-z|0-9]+)*([.][a-z|" +
@"0-9]+([_][a-z|0-9]+)*)?@[a-z][a-z|0-9|]*\.([a-z]" +
@"[a-z|0-9]*(\.[a-z][a-z|0-9]*)?)$";
System.Text.RegularExpressions.Match match
= Regex.Match(Email_Address, pattern, RegexOptions.IgnoreCase);
if (!match.Success)
{
return false;
}
else
{
return true;
}
}
We’ll send entered email Id as a parameter to this
function & it will return true or false. We can show message as per our
requirement if it returns false.