%@language = "VBscript"%>
<%
'NOVUSWARE: BUSINESS SOLUTIONS FORM MAILER PROGRAM.
'DO NOT REMOVE THIS SECTION OR NOTHING WILL WORK
Dim strError
Dim strRetVal
Dim errorFlag
Dim objFM
Dim objMailx
errorFlag = False
Response.Buffer = True
%>
<%
'variables you can set start here
'Change this during production to the one below!!! Put the email address you want the form sent to here in development
'strRcpt = "chitnismandar@yahoo.com"
strRcpt = "sales@fuel-card.co.uk" 'Put the email address you want the form sent to here in production
'Change this to the directory where the HTML files will be stored during production to the one below!!! In our case it is /public_html
'strHTMLDir = "/beta/"
strHTMLDir = "/" 'Enable this directory for production
'If you want a reply-to email address to be taken from the form put the name of the input item here.
strFromVar = "personEmail"
strDefFrom = "unknow@unknown.com" 'Default From address
'Put the subject of the letter here. If an input item called
'subject exists in the form, its value will be used instead.
strDefSubject = "Business Solution Query"
strDefBody = " has sent a query through the business solution form."
strBody = ""
'Url to redirect to after a successful form submission. If an input item called redirect exists in the form, its value will be used instead.
strSuccRedirect = strHTMLDir & "thanks.htm"
'Url to redirect to after an error form submission. If an input item called redirect exists in the form, its value will be used instead.
strErrRedirect = strHTMLDir & "business_solutions.asp"
strSuccMsg1 = "Thank you "
strSuccMsg2 = " for your application. Your application has been received and will be processed shortly."
strEmailFooter = "--------------------------------------------------------------" & Chr(10)
strEmailFooter = strEmailFooter & "This message has been sent to you by the Cambrian Form Emailer." & Chr(10)
strEmailFooter = strEmailFooter & "--------------------------------------------------------------" & Chr(10)
'form data variables
strName = ""
strBusQuery = ""
strCompany = ""
strAddress = ""
strTel = ""
strFax = ""
strEmail = ""
'variables you can set end here
%>
<%
'Check if required objects are present
Dim scriptObjName
Dim emailObjName
scriptObjName = "Scripting.Dictionary"
emailObjName = "CDONTS.Newmail"
If Request("REQUEST_METHOD") = "POST" Then
strRetVal = IsScriptingEngineInstalled
If Len(strRetVal) > 1 Then
ReportError strErrRedirect, strRetVal
End If
strRetVal = IsEmailComponentInstalled(scriptObjName)
If Len(strRetVal) > 1 Then
ReportError strErrRedirect, strRetVal
End If
strRetVal = IsEmailComponentInstalled(emailObjName)
If Len(strRetVal) > 1 Then
ReportError strErrRedirect, strRetVal
End If
'Set objFM = CreateObject("Scripting.Dictionary")
'Set objMailx = CreateObject("CDONTS.Newmail")
Else
strError = Session("ERR_MSG")
If Len(strError) > 1 Then
errorFlag = True
End If
End If
%>
<%
If Request("REQUEST_METHOD") = "POST" Then
Set objFM = CreateObject("Scripting.Dictionary")
Set objMailx = CreateObject("CDONTS.Newmail")
'main form processing and mail routine functionality
ParseForm objFM
strRetVal = CheckForm(objFM)
If Len(strRetVal) > 0 Then
ReportError strErrRedirect, strRetVal
End If
strRetVal = SeqForm(objFM)
If Len(strRetVal) < 1 Then
strRetVal = FormToString(objFM)
End If
If Len(strRetVal) < 1 Then
ReportError strErrRedirect, "Submitted form is empty"
End If
'form data
strName = objFM.Item("personName")
strBusQuery = objFM.Item("busQuery")
strCompany = objFM.Item("company")
strAddress = objFM.Item("address")
strTel = objFM.Item("personTel")
strFax = objFM.Item("personFax")
strEmail = objFM.Item("personEmail")
'put form data in session
Session("PERSON_NAME") = strName
Session("BUS_QUERY") = strBusQuery
Session("COMPANY") = strCompany
Session("ADDRESS") = strAddress
Session("PERSON_TEL") = strTel
Session("PERSON_FAX") = strFax
Session("PERSON_EMAIL") = strEmail
strSubject = strDefSubject
If objFM.Exists("TGsubject") Then
strSubject = objFM.Item("TGsubject")
End If
strFrom = strDefFrom
If Len(strFromVar) > 0 Then
If objFM.Exists(strFromVar) Then strFrom = objFM.Item(strFromVar) End If
End If
strBody = strName & strDefBody & Chr(10)& Chr(10)
strBody = strBody & "Name: " & strName & Chr(10)
strBody = strBody & "Query: " & strBusQuery & Chr(10)
strBody = strBody & "Company: " & strCompany & Chr(10)
strBody = strBody & "Address: " & strAddress & Chr(10)
strBody = strBody & "Telephone: " & strTel & Chr(10)
strBody = strBody & "Fax: " & strFax & Chr(10)
strBody = strBody & "Email : " & strFrom & Chr(10) & Chr(10)
strBody = strBody & Chr(10) & Chr(10) & strEmailFooter
strRetVal = SendMail(strFrom,strRcpt,strSubject,strBody)
If Len(strRetVal) > 0 Then
ReportError strErrRedirect, strRetVal
End If
If Len(strSuccRedirect) > 0 Then
'clean up session variables
Session("ERR_MSG") = ""
Session("PERSON_NAME") = ""
Session("BUS_QUERY") = ""
Session("COMPANY") = ""
Session("ADDRESS") = ""
Session("PERSON_TEL") = ""
Session("PERSON_FAX") = ""
Session("PERSON_EMAIL") = ""
Response.redirect strSuccRedirect
Response.End
End If
If objFM.Exists("TGredirect") = True Then
If Len(objFM.Item("TGredirect")) > 0 Then
'clean up session variables
Session("ERR_MSG") = ""
Session("PERSON_NAME") = ""
Session("BUS_QUERY") = ""
Session("COMPANY") = ""
Session("ADDRESS") = ""
Session("PERSON_TEL") = ""
Session("PERSON_FAX") = ""
Session("PERSON_EMAIL") = ""
Response.redirect(objFM.Item("TGredirect"))
Response.End
End If
End If
End If
strName = Session("PERSON_NAME")
strBusQuery = Session("BUS_QUERY")
strCompany = Session("COMPANY")
strAddress = Session("ADDRESS")
strTel = Session("PERSON_TEL")
strFax = Session("PERSON_FAX")
strEmail = Session("PERSON_EMAIL")
%>
Cambrian Fuel Card Business Solutions
Could your business do with better fleet management
solutions? If so, call one of our business consultants at 01633
677 677, or post your
query below. Our consultants will get in touch within 24 business
hours with solutions.