<% recaptcha_challenge_field = Request("recaptcha_challenge_field") recaptcha_response_field = Request("recaptcha_response_field") recaptcha_public_key = "6LcdfBgTAAAAAACtvw27TT9EDnc4QdxxhgTXfWe_" ' your public key recaptcha_private_key = "6LcdfBgTAAAAAHTqK4KAdFH3EMySJBSNE29j_hRC" ' your private key ' returns the HTML for the widget function recaptcha_challenge_writer() recaptcha_challenge_writer = _ "" & _ "" & _ "" end function ' returns "" if correct, otherwise it returns the error response function recaptcha_confirm(rechallenge,reresponse) Dim VarString VarString = _ "privatekey=" & recaptcha_private_key & _ "&remoteip=" & Request.ServerVariables("REMOTE_ADDR") & _ "&challenge=" & rechallenge & _ "&response=" & reresponse Dim objXmlHttp Set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP") objXmlHttp.open "POST", "https://www.google.com/recaptcha/api/verify", False objXmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" objXmlHttp.send VarString Dim ResponseString ResponseString = split(objXmlHttp.responseText, vblf) Set objXmlHttp = Nothing if ResponseString(0) = "true" then 'They answered correctly recaptcha_confirm = "" else 'They answered incorrectly recaptcha_confirm = ResponseString(1) end if end function server_response = "" newCaptcha = True if (recaptcha_challenge_field <> "" or recaptcha_response_field <> "") then server_response = recaptcha_confirm(recaptcha_challenge_field, recaptcha_response_field) newCaptcha = False end if %> Berth & Boat sales - Roydon Marina Village

BERTH / BOAT SALES

ROYDON MARINA VILLAGE, ROYDON, ESSEX CM19 5EJ

Holidays: 0844 822 1670
Lodge Ownership: 01279 792777
Marina: 01279 792777

BERTH & BOAT ENQUIRY FORM

<% if server_response <> "" or newCaptcha then %> <% if newCaptcha = False then %>

Something went wrong, please try again!

<% end if %>











<%=recaptcha_challenge_writer()%>

<% else %>

Thank you - your enquiry has been received and will be dealt with soon.

 

 

 

 

 

 

 

 

<% contact_name = request.form("Name") contact_email = request.form("Email") contact_phone = request.form("Phone") 'build the html for email strHTML = "You have received a hotel enquiry, please see below:" & vbcrlf & vbcrlf strHTML = strHTML & "Timestamp: " & now() & vbcrlf & vbcrlf strHTML = strHTML & vbcrlf strHTML = strHTML & "Contact Details: " & vbcrlf strHTML = strHTML & "Name: " & Request.Form("Name") & vbcrlf strHTML = strHTML & "Address: " & Request.Form("Address") & vbcrlf strHTML = strHTML & "Phone: " & Request.Form("Phone") & vbcrlf strHTML = strHTML & "Email: " & Request.Form("Email") & vbcrlf strHTML = strHTML & "Length: " & Request.Form("Length") & vbcrlf strHTML = strHTML & "Beam: " & Request.Form("Beam") & vbcrlf strHTML = strHTML & "Duration of stay: " & Request.Form("Duration") & vbcrlf strHTML = strHTML & "How did you hear about us: " & vbcrlf strHTML = strHTML & Request.Form("Hear") & vbcrlf 'this is the subject of the email emailSubject = "Berth and Boat Sales - New Enquiry" 'email config Set cdoConfig = CreateObject("CDO.Configuration") Set cdoMessage = CreateObject("CDO.Message") With cdoConfig.Fields .Item(cdoSendUsingMethod) = cdoSendUsingPort .Item(cdoSMTPServer) = "localhost" .Update End With 'sending details With cdoMessage Set .Configuration = cdoConfig .To = "marinaoffice@roydonmarinavillage.co.uk" .cc = "terry.rogers@roydonmarinavillage.co.uk, david.copley@darinian.co.uk" .From = "info@roydonmarinavillage.co.uk" .Subject = emailSubject .TextBody = strHTML .Send End With 'closes config Set cdoMessage = Nothing Set cdoConfig = Nothing %> <%end if%>