% @LANGUAGE = VBScript %>
<%
Option Explicit
Response.Expires = 0
' Variables for form fields
Dim strFullName, strOrganization, strStreetAddress, strAddress2, strCity, strState
Dim strZipCode, strWorkPhone, strEveningPhone, strMobilePhone, strFax, strEmail, strQuery
' Validation flags for form fields
Dim flgFullName, flgOrganization, flgStreetAddress, flgAddress2, flgCity, flgState
Dim flgZipCode, flgWorkPhone, flgEveningPhone, flgMobilePhone, flgFax, flgEmail, flgQuery
' Other variables
Dim objMail, strMailTo, strMailFrom, strMailSubject, strMailBody, strDefaultDate, strReplyTo
Dim flgAll, flgFromhere, flgError, strErrormsg, strBackground, strRedirect, strThisPage, flgPrevError
Dim objOptionDict, strOptionName, strOptionValue
strThisPage = Request.ServerVariables("SCRIPT_NAME")
' If the form is being reprocessed, we need to do some basic validation.
If Trim(Request.Form("Submit")) <> "" Then
strFullName = Trim(Request.Form("Contact_FullName"))
strOrganization = Trim(Request.Form("Contact_Organization"))
strStreetAddress = Trim(Request.Form("Contact_StreetAddress"))
strAddress2 = Trim(Request.Form("Contact_Address2"))
strCity = Trim(Request.Form("Contact_City"))
strState = Trim(Request.Form("Contact_State"))
strZipCode = UCase(Trim(Request.Form("Contact_ZipCode")))
strWorkPhone = Trim(Request.Form("Contact_WorkPhone"))
strEveningPhone = Trim(Request.Form("Evening_Phone"))
strMobilePhone = Trim(Request.Form("Mobile_Phone"))
strFax = Trim(Request.Form("Contact_FAX"))
strEmail = Trim(Request.Form("Contact_Email"))
strQuery = Trim(Request.Form("query"))
' Initialise error flags
flgFullName = ""
flgOrganization = ""
flgStreetAddress = ""
flgAddress2 = ""
flgCity = ""
flgState = ""
flgZipCode = ""
flgWorkPhone = ""
flgEveningPhone = ""
flgMobilePhone = ""
flgFax = ""
flgEmail = ""
flgQuery = ""
' Mandatory fields
If strFullName = "" Then
flgFullName = "1"
End If
If strStreetAddress = "" Then
flgStreetAddress = "1"
End If
If strCity = "" Then
flgCity = "1"
End If
If strZipCode = "" Then
flgZipCode = "1"
End If
If strWorkPhone = "" Then
flgWorkPhone = "1"
End If
If strEmail = "" Then
flgEmail = "1"
End if
flgAll = flgFullName & flgStreetAddress & flgCity & flgZipCode & flgWorkPhone & flgEmail
' If no error flags are set, then proceed to process the form.
' Send an email to log the request, and tell the user we can help
If flgAll = "" Then
' Send mail to yachts for fun
' Load up a dictionary containing Option field names and descriptions
LoadDictionary
' Default the "from" and "reply-to" address if no email address entered
If strEmail = "" Then
strMailFrom = "davido@yachtsforfun.com"
'strMailFrom = "katarzyna@pimdesign.com"
strReplyTo = ""
Else
strMailFrom = strEmail
strReplyTo = strEmail
End If
strMailTo = "davido@yachtsforfun.com"
'strMailTo = "katarzyna@pimdesign.com"
strMailSubject = "Enquiry from Yachts for fun"
strMailBody = "A visitor to the Yachts for fun web site submitted"
strMailbody = strMailBody & " the following information on " & FormatDateTime(Now, 1)
strMailBody = strMailBody & " at " & FormatDateTime(Now, 4) & ": " & "
"
' See which options have been selected, and add text as appropriate
strMailBody = strMailBody & "Client expressed interest in the following:" & "
"
For Each strOptionName in objOptionDict
If Trim (Request.Form(strOptionName)) = "ON" Then
strOptionValue = "<------ selected "
Else
strOptionValue = " "
End If
strMailBody = strMailBody & objOptionDict.Item(strOptionName) & " " & strOptionValue & "
"
Next
' Query field from form:
If strQuery = "" Then
strQuery = "(No query entered)"
End If
strMailBody = strMailBody & " " & "Client typed in the following query:" & " "
strMailBody = strMailBody & strQuery & " "
Set objMail = Server.CreateObject("CDO.Message")
'This section provides the configuration information for the remote SMTP server.
ObjMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
ObjMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.pim2.co.uk"
ObjMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
ObjMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
' If your server requires outgoing authentication uncomment the lines below and use a valid email address and password.
ObjMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
ObjMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="postmaster@yachtsforfun.com" 'no email on mail server! have exchange server
ObjMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="s69xea"
ObjMail.Configuration.Fields.Update
'End remote SMTP server configuration section==
objMail.From = Trim(strMailFrom)
objMail.To = Trim(strMailTo)
objMail.Subject = Trim(strMailSubject)
objMail.HTMLBody = Trim(strMailBody)
If strReplyTo <> "" Then
objMail.ReplyTo = strReplyTo
End If
objMail.Send
Set objMail = Nothing
' Courtesy mail to customer would go here if required
strRedirect="confirmation.htm"
Response.Redirect (strRedirect)
Else
flgError = "y"
End If
Else ' First time through - initialise variables
strErrorMsg = ""
End If
%>
<%
' Load dictionary object with Option field names and descriptions
Sub LoadDictionary
Set objOptionDict = Server.CreateObject("Scripting.Dictionary")
objOptionDict.Add "Option_Anniv", "Wedding Anniversary Specials"
objOptionDict.Add "Option_Stag Days", "Stag Days - Yacht/RIB Combo"
objOptionDict.Add "Option_40th Birthday Celebrations", "40th Birthday Celebrations"
objOptionDict.Add "Option_Introductory Day Sail", "Introductory Dail Sail"
objOptionDict.Add "Option_Corporate Days Out", "Corporate Days Out"
objOptionDict.Add "Option_Team Building", "Team Building"
objOptionDict.Add "Option_Family Days Out", "Family Days Out"
objOptionDict.Add "Option_Father and Sons", "Father and Sons"
objOptionDict.Add "Option_Mums and Daughters", "Mums and Daughters"
objOptionDict.Add "Option_RYA", "RYA Competent Crew and Day Skipper courses"
objOptionDict.Add "Option_Champagne Sunrise Breakfasts", "Champagne Sunrise Breakfasts"
objOptionDict.Add "Option_Champagne Sunset Supper", "Champagne Sunset Supper"
objOptionDict.Add "Option_Cowes Week", "Cowes Week"
objOptionDict.Add "Option_Cowes Fireworks", "Cowes Fireworks"
objOptionDict.Add "Option_Round the Islands", "Round the Island"
objOptionDict.Add "Option_Four Day Specials to France", "Four Day Specials to France"
objOptionDict.Add "Option_30th Birthday Celebrations", "30th Birthday Celebrations"
objOptionDict.Add "Option_Overnight Anchorages", "Overnight Anchorages"
End Sub
%>
Yachts For Fun UK - Skippered Yacht Charter - About your boat
Insight Yacht Charter
Cricket Corner
Lynch Hill Park
Witchurch, RG28 7NF
UK
Yachtsforfun provides
yacht and boat charter in the Solent and the English Channel.
We offer tailored events from social chartering to full blown training events.
We also offer programmes from complete beginners to experienced charters for
qualified skippers and crew.