<% 'Specify your captcha length here, this is the only configuration requirement captchaLength = 5 Function captcha(captchaLength) if captchaLength > 15 then captchaLength = 15 HighestValue = left(100000000000000,captchaLength) lowestValue = left(999999999999999,captchaLength) Randomize intHighestNumber = Int((HighestValue - LowestValue + 1) * Rnd) + LowestValue session("captcha") = Int(intHighestNumber) x = 1 response.write vbcrlf & "" & vbcrlf & vbtab & "" & vbcrlf while x <= captchaLength response.write vbtab & vbtab & "" & vbcrlf x = x + 1 wend response.write vbtab & "" & vbcrlf & "
" & vbcrlf End Function %> <% ' Newsletter Signup ' Declare Vars used in form Dim name, email, phone, comments Dim CaptchaBox Dim varDate varDate = (Monthname(Month(Date)) & " " & Day(date) & ", " & Year(date)) ' Get Posted Vars name = Request("name") phone= request("phone") email = Request("email") comments = Request("comments") CaptchaBox = Request("CaptchaBox") '****CAPTCHA CHECK if request("action") = "captcha" then if cstr(request("captcha")) = cstr(session("captcha")) then Dim NextFlag NextFlag = "Y" Dim ErrorMessage ' Do Validation of Fields from this page if Request("formsubmit") = "Y" then ' Error Checks if len(name) < 3 then ErrorMessage = ErrorMessage & "Please provide your name...
" NextFlag = "N" end if if len(email) <> "" then if Instr((Request.Form("email")), "@") = 0 or Instr((Request.Form("email")), ".") = 0 or len(Request.Form("email")) < 6 then ErrorMessage = ErrorMessage & "Your E-Mail Address...
" NextFlag = "N" end if end if ' Move on if Everything Checks Out if NextFlag = "Y" then ' Send Mail and do any processing here. ' ========================================================================================== ' BEGIN CODE TO SEND MAIL ' ========================================================================================== ' ========================================================================================== ' SEND MAIL TO WEB SITE OWNER ' ========================================================================================== EMbody = "********** BEGIN OF EMAIL MESSAGE **********" EMbody = EMbody & vbcrlf & " " EMbody = EMbody & vbcrlf & "Name: " & Request.Form("name") EMbody = EMbody & vbcrlf & " " EMbody = EMbody & vbcrlf & "E-Mail: " & Request.Form("email") EMbody = EMbody & vbcrlf & " " EMbody = EMbody & vbcrlf & "Phone: " & Request.Form("phone") EMbody = EMbody & vbcrlf & " " EMbody = EMbody & vbcrlf & "Comments: " & Request.Form("Comments") EMbody = EMbody & vbcrlf & " " EMbody = EMbody & vbcrlf & "********** END OF EMAIL MESSAGE **********" Dim NextPage, MAILSERVER, CUSTOMER, PRIMARY, SECONDARY, SUBJECT NextPage = "index.asp#elists" MAILSERVER = "websmtp3.globalweb.net" CUSTOMER = Request.Form("email") PRIMARY = "neil@hillcrestenterprises.com" SECONDARY = " " SUBJECT = "Online Inquiry - Hillcrest Enterprises" ' JMail Settings Set Mailer = Server.CreateObject("JMail.SMTPMail") Mailer.ServerAddress = MAILSERVER Mailer.Sender = CUSTOMER Mailer.AddRecipient PRIMARY ' Mailer.AddRecipientBCC SECONDARY 'the following BCCs are in for testing phase only ' Mailer.AddRecipientBCC " " ' Mailer.AddRecipientBCC " " Mailer.Subject = SUBJECT Mailer.Body = EMbody Mailer.ISOEncodeHeaders = false Mailer.Execute Set Mailer = nothing ' ========================================================================================== ' END CODE TO SEND MAIL ' ========================================================================================== 'Remed Out as not needed with variable THANK YOU check 'Response.Redirect nextpage varFormsubmitshow = "Y" end if end if 'CAPTCHA END_IF else CError = "Confirmation did not match!" end if end if %> Contact Hillcrest Enterprises

Contact Us

<% if len(CError) > 1 then %>

<%=CError%>
<% end if %> <% if len(ErrorMessage) > 1 then %>

Please Note! The Following Information is Required!:
<%=ErrorMessage%>
<% end if %> <% if varFormsubmitshow = "Y" then %>

Thank You!

Your comments / questions have been submitted and we will be responding to you as soon as possible!

<% else %>
Name: (required)
Phone Number:
E-mail: (required)
Comments / Questions: Confirmation:

<%captcha(captchaLength)%>
<% End If %>
Hillcrest Enterprises, Inc.

11092 Air Park Road,
Ashland, VA 23005

Telephone: (804) 798-8390
FAX:(804) 752-7830
E-mail: info@hillcrestenterprises.com