Search This Blog

Pages

Sunday, February 13, 2011

Check whether email id is valid or not using asp

Check the given id is valid or not using asp. Below code is used for validate the email id


<%
Dim email,chk
Dim RExp : set RExp = new RegExp
with RExp
.Pattern = "^([0-9a-zA-Z]([-.w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-w][^_]*[0-9a-zA-Z].)+[a-zA-Z]{2,9})$"
.IgnoreCase = True
.Global = True
end with
email= "test@test.com"
chk=RExp.test(email)
if(chk="True") then
Response.Write("Valid Email id")
else
Response.Write("InValid Give proper mail id")
end if
%>

No comments:

Post a Comment