Script for the verification of the fields of a form before sending the e-mail.
<%
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@aspitalia"))
if blnMail = True then
Response.write "<p>E-mail valida"
else
Response.write "<p>E-mail non valida"
end if
%>