Verifica

Questo script serve per verificare dei campi di una form per inviare email:

<% 
Function CheckMail(strMail) 
if len(strMail)>6 then 
pos = Instr(1,strMail, "@") 
if pos >= len(strMail)-3 then 
Exit Function 
end if 
if pos < 2 then 
Exit Function 
end if 
dotpos = Instr(pos+1 ,strMail, ".") 
if dotpos > len(strMail)-2 then 
Exit Function 
end if 
if len( Mid(strMail, pos+1) ) < 5 or dotpos = 0 then 
Exit Function 
end if 
CheckMail = True 
else 
CheckMail = False 
end if 
End function 

blnMail = CBool(checkMail("test@tiscali")) if blnMail = True then Response.write "<p>E-mail valida" else Response.write "<p>E-mail non valida" end if %>