Contact Us
Please fill in your details below:
%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% function TestCaptcha(byval valSession, byval valCaptcha) dim tmpSession valSession = Trim(valSession) valCaptcha = Trim(valCaptcha) if (valSession = vbNullString) or (valCaptcha = vbNullString) then TestCaptcha = false else tmpSession = valSession valSession = Trim(Session(valSession)) Session(tmpSession) = vbNullString if valSession = vbNullString then TestCaptcha = false else valCaptcha = Replace(valCaptcha,"i","I") if StrComp(valSession,valCaptcha,1) = 0 then TestCaptcha = true else TestCaptcha = false end if end if end if end function %> <% if not IsEmpty(Request.Form("submit")) then dim errormessage errormessage = "" if TestCaptcha("ASPCAPTCHA", Request.Form("captchacode")) then ' Get the form data senderEmail = Request.Form("email") subject = "Enquiry from CBS Blinds website" recipient = "sales@cbsblinds.co.uk" Dim mail_Body mail_Body = subject & vbCrLf & vbCrLf mail_Body = mail_Body & "Submitted at " & Now() & vbCrLf & vbCrLf mail_Body = mail_Body & "Name: " & Request.form("yourname") & vbCrLf mail_Body = mail_Body & "Organisation: " & Request.form("organisation") & vbCrLf mail_Body = mail_Body & "Address:" & vbCrLf mail_Body = mail_Body & Request.form("address") & vbCrLf mail_Body = mail_Body & "Telephone: " & Request.form("telephone") & vbCrLf mail_Body = mail_Body & "Email Address: " & Request.form("email") & vbCrlf & vbCrlf mail_Body = mail_Body & "Enquiry Message:" & vbCrLf mail_Body = mail_Body & Request.form("enquiry") & vbCrLf & vbCrLf mail_Body = mail_Body & "Send information by: " & vbCrlf if Request.Form("sendbyemail") = "sendbyemail" then mail_Body = mail_Body & "Email" & vbCrlf if Request.Form("sendbypost") = "sendbypost" then mail_Body = mail_Body & "Post" & vbCrlf if Request.Form("callme") = "callme" then mail_Body = mail_Body & "Call Me" & vbCrlf strReferer = request.servervariables("HTTP_REFERER") strServer = Replace(request.servervariables("SERVER_NAME"),"www.","") strSMTPServer = "smtp." & strServer ' check referer intComp = inStr(strReferer, strServer) If intComp > 0 Then blnSpam = False Else ' Spam Attempt Block blnSpam = True End If ' Create the JMail message Object set msg = Server.CreateOBject( "JMail.Message" ) ' Set logging to true to ease any potential debugging ' And set silent to true in case you wish to handle the errors yourself msg.Logging = true msg.silent = true ' Enter the sender data msg.From = senderEmail ' Note that as addRecipient is a method and not ' a property, you do not use an equals ( = ) sign msg.AddRecipient recipient ' The subject of the message msg.Subject = subject ' And the body msg.body = mail_Body ' Now send the message, using the indicated mailserver If NOT blnSpam Then if not msg.Send(strSMTPServer ) then Response.write "
" & msg.log & "" else Response.write "Message sent successfully!" end if end if ' Clear the object set msg = nothing 'Send them to the page specified if requested Dim rp_redirect rp_redirect = "contact-thanks.html" If (rp_redirect <> "") then Response.Redirect rp_redirect End If else errormessage = "
Please fill in your details below:
CBS Blinds, West Drive, Lancaster, LA1 5BY tel: 01524 383000 fax: 01524 383111 email: sales@cbsblinds.co.uk
Site by Cypher