email validation at server side

Posted by Sravanthi.seeta under ASP.NET on 11/13/2010 | Points: 10 | Views : 6824 | Status : [Member] | Replies : 3
when we are performing the validation of an Email, it will checks the format of the mail and which can be checked on client Side..... But How we find that Email is valid on the server or not..................
as "asasjdohaiugfdyfgyugsd@sdf.com" gives valid from ur code while Domain name is not valid. You have any code to validate that type of email.




Responses

Posted by: SheoNarayan on: 11/13/2010 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Hi Sravanthi.seeta,

Thanks for asking question. I have written an article that will help you in checking for a valid domain, read it here http://www.dotnetfunda.com/articles/article1072-validating-domain-name-in-aspnet-.aspx

I am assuming that you already know how to validate the email id so after validating the email address if its correct, validate the domain name using above article that may work for you.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Sravanthi.seeta, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sivaprasadadiraju on: 11/26/2010 [Member] Starter | Points: 25

Up
0
Down
Hi Sravanthi,

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(Emailid, pattern, RegexOptions.IgnoreCase);

if (!match.Success)
{
string strpopup = "alert(\"Please enter valid Email Id\");";
ScriptManager.RegisterStartupScript(this, typeof(Page), "script", strpopup, true);
return;
}


SIVA PRASAD ADIRAJU

Sravanthi.seeta, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vinay13mar on: 11/25/2012 [Member] Starter | Points: 25

Login to post response