<%
Function getFileName()
Dim lsPath, arPath
lsPath = Request.ServerVariables("SCRIPT_NAME")
arPath = Split(lsPath, "/")' split path into array and grab last item for file name
getFileName = arPath(UBound(arPath,1))
End Function
function displayForm()
%>
<%
end function
function createmail()
adminEmail = "auto_response@bcsheatingandcooling.co.uk"
recipEmail = request.Form("Email")
senderEmail = adminEmail
destEmail = "info@bcsheatingandcooling.co.uk"
companyName = "B C S - Heating And Cooling"
siteURL = "bcsheatingandcooling.co.uk"
subject = "Enquiry Confirmation - " & companyName
message = "
Thank you for your enquiry, we will be in touch shortly.
" & vbcrlf
message = message & "
" & companyName & "
"
call sendemail(recipEmail, senderEmail, subject, message)
recipEmail = destEmail
senderEmail = adminEmail
subject = "Enquiry for B C S - Heating And Cooling"
message = "
An enquiry from " & siteURL & " has been received.
" & vbcrlf
for each item in Request.form
if len(Request.form(item)) > 0 then
if item <> "reqType" and item <> "destEmail" then
message = message & item & ": " & Request.form( item ) & "
" & vbcrlf
end if
end if
next
'response.write("SENDING:" & recipEmail & " " & senderEmail & " " & subject & " " & message)
call sendemail(recipEmail, senderEmail, subject, message)
'response.write("sent email")
end function
reqType = request.form("reqType")
if reqType = "send" then
'response.write("checking if valid")
call checkIfPresent("Name", request.Form("Name"))
call checkIfEmail("Email", request.Form("Email"), true)
call checkIfPresent("Message", request.Form("Message"))
call checkIfMenuSelected("Country", request.Form("destEmail"))
if errorMessage = empty then
if session("sent") = false then
'response.write("first time")
call createmail()
session("sent") = true
%>
Thank you for your enquiry.
A confirmation email will be sent to you shortly.
<%
else
'response.write("already sent")
%>
Your enquiry has been already been sent.
<%
end if
else
response.write("
![]()
" & vbcrlf)
response.write("
" & errorMessage & "
" & vbcrlf)
displayForm()
end if
else
session("sent") = false
displayForm()
end if
%>