<% 'send contact email Public Function sendfeedbackemail() Dim sender, whodat, whoto, Body sender = request("from") whodat = request("fromemail") whoto = "chris@thehouseofjohnson.net" %> <% IF sender = "" then error = "y" %> <% Else Body = "Driver: " + sender + "    " END IF %> <% IF IsValidEmail(whodat) = "False" THEN error = "y" %> <% ELSE Body = Body + "Email: " + whodat + "    " END IF %> <% IF request("license") = "" then error = "y" %> <% Else Body = Body + "DL number: " + request("license") + "    " END IF %> <% IF request("state") = "" then error = "y" %> <% Else Body = Body + "State: " + request("state") + "

" END IF %> <% IF request("address1") = "" then error = "y" %> <% Else Body = Body + "Address: " + request("address1") + "    " if request("address2") = "" THEN response.Write "" Else Body = Body + "Address2: " + request("address2") + " " END IF END IF %> <% IF request("city") = "" then error = "y" %> <% Else Body = Body + "City: " + request("city") + "    " END IF %> <% IF request("zipcode") = "" then error = "y" %> <% Else Body = Body + "Zipcode: " + request("zipcode") + "

" END IF %> <% IF request("phone") = "" then error = "y" %> <% Else Body = Body + "Phone: " + request("phone") + "    " END IF %> <% IF request("emercontact") = "" then error = "y" %> <% Else Body = Body + "Emergency contact: " + request("emercontact") + "    " END IF %> <% IF request("emercontactnum") = "" then error = "y" %> <% Else Body = Body + "Emergency contact #: " + request("emercontactnum") + "

" END IF %> <% IF request("carmake") = "" then error = "y" %> <% Else Body = Body + "Car Make: " + request("carmake") + "    " END IF %> <% IF request("carmodel") = "" then error = "y" %> <% Else Body = Body + "Car model: " + request("carmodel") + "    " END IF %> <% IF request("caryear") = "" then error = "y" %> <% Else Body = Body + "Car year: " + request("caryear") + "    " END IF %> <% If request("carplate") = "" THEN response.Write "" ELSE Body = Body + "Plate number: " + request("carplate") + "    " END IF If request("carnumber") = "" THEN response.Write "" ELSE Body = Body + "Car number: " + request("carnumber") END IF %> <% IF request("eventdate") = "" then error = "y" %> <% Else Body = Body + "

Event: " + request("eventdate") + "    " END IF %> <% IF request("class") = "" then Response.Write "" Else Body = Body + "Class: " + request("class") + "    " END IF %> <% IF error = "" then Dim objErrMail, bodyimage, bodyimagetop bodyimage = "

" bodyimagetop = "
" Set objErrMail= Server.CreateObject("CDO.Message") With objErrMail .From = whodat .To = whoto .Subject = "RGVPCA Event Registration" .HTMLBody = bodyimagetop & Body & bodyimage .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.thehouseofjohnson.net" .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "houseofjohnson\chris johnson" .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "CSEregion4" .Configuration.Fields.Update .Send End With Set objErrMail=Nothing Set Body=Nothing Set whodat=Nothing Set whoto=Nothing set bodytext=Nothing set sender=Nothing set bodyimage=Nothing set bodyimagetop=Nothing 'Display to the user that their message was sent %> <% ELSE %> <% END IF %>
  • you did not enter your name!
  • you did not enter a valid email address!
  • you did not enter your driver's license number!
  • you did not enter your state!
  • you did not enter your street address!
  • you did not enter your city!
  • you did not enter your zipcode!
  • you did not enter your phone number!
  • you did not enter an emergency contact!
  • you did not enter your emergency contacts phone number!
  • you did not enter your cars make!
  • you did not enter your cars model!
  • you did not enter the year your car was made!
  • you did not enter the date of the event!
Your feedback was successfully sent.
Click BACK to try again.
<% End Function 'function to verify email address Function IsValidEmail(emailAddress) Dim ValidEmail, emailParts, iLoopCounter, emailChar, acceptableChars ValidEmail = True 'set the default result to True acceptableChars="abcdefghijklmnopqrstuvwxyz.-_@" emailParts = Split(emailAddress, "@") If UBound(emailParts) <> 1 Then ValidEmail = false Else If Len(emailParts(0))<1 OR Len(emailParts(1))<4 Then ValidEmail = false End If If Left(emailParts(0), 1)="." Then ValidEmail = false End If If Right(emailParts(1), 1) = "." OR Right(emailParts(1), 2) = "." Then ValidEmail = false End If If InStr(emailParts(1), ".") <= 0 Then ValidEmail = false End If If InStr(emailParts(1), "_") >0 Then ValidEmail = false End If End If For iLoopCounter = 1 to Len(emailAddress) emailChar = Lcase(Mid(emailAddress, iLoopCounter, 1)) If InStr(acceptableChars, emailChar) = 0 and Not IsNumeric(emailChar) Then ValidEmail = false End if Next If InStr(emailAddress, "..") > 0 Then ValidEmail=false End If If InStr(emailAddress, "@.") > 0 Then ValidEmail=false End If IsValidEmail=ValidEmail End function %>
<% IF request("feedback") = "y" THEN %> <% ELSE %> <% END IF %>
<% Call sendfeedbackemail() %>
Please fill the infomation out below. All fields marked with an (*) are required.
Driver's name:*  
Driver's email address:*  
Driver's license #:*  
Street Address:*  
Street Address 2:  
City:*  
State:*  
Zipcode:*  
Driver's phone #:*  
Emergency contact:*  
Emergency contact phone #:*  
Car make:*  
Car model:*  
Year:*  
License plate #:  
Car #:  
Event Start Date (MM/DD/YYYY):*  
Class: