Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     

Server side Email validation

Server side Email validation in

In mostly forms where user enter his email ids. There is need to verify the email format for user because mostly users enter sometime wrong format of email etc. so we are giving the solution for emails validation at server side:

public static bool IsEmail(string Email)
string strRegex = @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" +
@"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" +
Regex re = new Regex(strRegex);
if (re.IsMatch(Email))
return (true);
return (false);

Call this function when validating the value like:

if (IsEmail(Textbox1.Text))

Share this article   |    Print    |    Article read by 2998 times
Rohit kakria
I am software developer, moderator of
Related Articles:
Related Interview Questions: No related interview question