%@LANGUAGE="VBSCRIPT"%> <% ' DO NOT REMOVE THE FOLLOWING LINE ' newsletter = "yes" ' uncomment to add to newsletter - requires connections file adding ' LEWIS ' Restaurant Name for form restname = "Print Plus" ' email address 'sendmail = "lewis@sugarvine.com" sendmail = "sales@printplusblackpool.com" ' url for confirmation url = "http://www.printplusgroup.com/" '"printplusgroup" ' email validation routine function chkEmail(theAddress) dim atCnt chkEmail = 0 if instr(theaddress, "@.") <> false then chkEmail = 1 end if if len(theAddress) < 7 then chkEmail = 1 elseif instr(theAddress,"@") = 0 then chkEmail = 1 ' has at least one "." elseif instr(theAddress,".") = 0 then chkEmail = 1 ' has no more than 3 chars after last "." elseif len(theAddress) - instrrev(theAddress,".") > 4 then chkEmail = 1 ' has more than 1 chars after last "." elseif len(theAddress) - instrrev(theAddress,".") < 2 then chkEmail = 1 ' has no "_" after the "@" elseif instr(theAddress,"_") <> 0 and _ instrrev(theAddress,"_") > instrrev(theAddress,"@") then chkEmail = 1 ' has no "_" after the "@" elseif instr(theAddress,"..") <> 0 and _ instrrev(theAddress,"..") > instrrev(theAddress,"@") then chkEmail = 1 else ' has only one "@" atCnt = 0 for i = 1 to len(theAddress) if mid(theAddress,i,1) = "@" then atCnt = atCnt + 1 end if next if atCnt > 1 then chkEmail = 1 end if ' chk each char for validity for i = 1 to len(theAddress) if not isnumeric(mid(theAddress,i,1)) and _ (lcase(mid(theAddress,i,1)) < "a" or _ lcase(mid(theAddress,i,1)) > "z") and _ mid(theAddress,i,1) <> "_" and _ mid(theAddress,i,1) <> "." and _ mid(theAddress,i,1) <> "@" and _ mid(theAddress,i,1) <> "-" then chkEmail = 1 end if next end if end function ' end validation routine if request.form("Email") <> "" then if chkEmail(request.form("Email")) <> 1 then '--- old mailform script Dim shopMail, shopBody Set objErrMail= Server.CreateObject("CDO.Message") With objErrMail .From = request("Email") .To = sendmail .Subject = restname & " Web Form - " & request("subject") For x = 1 to Request.Form.Count if Request.Form.Key (x) <> "submit" and Request.Form.Key (x) <> "promotions" and Request.Form.Key (x) <> "email" then shopBody=shopBody & replace(replace(Request.Form.Key(x), "xylog", "email"), "ewe", "user name") & " = " & Request.Form.Item (x) & vbcrlf & vbcrlf end if Next shopBody=shopBody & "This email was sent on : " & date & " at " & time .TextBody = Cstr("" & shopbody) .Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "195.234.116.130" .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Configuration.Fields.Update .Send End With set objErrMail = nothing DIM custMail, custBody Set objErrMail= Server.CreateObject("CDO.Message") With objErrMail .From = sendmail .To = request.form("Email") .Subject = "Thank you "& request.form ("ewe") custBody=custBody & "Thank You " & request.form("ewe") & vbcrlf & vbcrlf custBody=custBody & "We have received your email and will deal with it promptly" & vbcrlf & vbcrlf custBody=custBody & restname & " - " & url & vbcrlf .TextBody = Cstr("" & custBody) .Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "195.234.116.130" .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Configuration.Fields.Update .Send End With set objErrMail = nothing '--- end old mailform else validate = "x" end if end if %>
![]() |
||||||||||||||
![]() |
<% if request.form("email") = "" or validate <> "" then %>
We have received your email.<%end if%> | |||||||||||||
![]() |
||||||||||||||