Check whether email id is valid or not using asp

by Nirmala 2009-09-02 14:58:25

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
%>

Tagged in:

2300
like
3
dislike
0
mail
flag

You must LOGIN to add comments