Preferred Member
joined:May 15, 2002
posts: 543
votes: 0
Having a problem. Thanks to Staffa my contact forms are working a treat, only problem is that im getting quite alot of spam so im thinking of adding some sort of email validation just to check the form is filled in correctly.
I tried adding -
if isEmailValid(Request.Form("Email")) = true then
'#### Send your email
else
'#### Email was invalid, give the user an error
response.write "Invalid email address"
end if
Function isEmailValid(email)
Set regEx = New RegExp
regEx.Pattern = "^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w{2,}$"
isEmailValid = regEx.Test(trim(email))
End Function
But nothing really happend and I was still able to send myself a blank form with nothing filled in on the Email box.
Can anyone give me any clues of a code or where to put it on my sendmail.asp script?
Thanks
Darren