%@LANGUAGE=VBSCRIPT%>
<%
requestType = request("Submit")
if (requestType = "Submit") then
name = request("name")
company = request("company")
city = request("city")
country = request("country")
telephone = request("telephone")
email = request("email")
details = request("details")
error = 0
message = "Please fill in all the required fields
"
if (name = "") then
message = message & "First Name
"
error = 1
end if
if (telephone = "") then
message = message & "Telephone Number
"
error = 1
end if
if (email = "") then
message = message & "Email Address
"
error = 1
end if
if(error=0) then
tmpl = Server.Mappath("contact_email.html")
Set fso = Server.CreateObject("Scripting.Filesystemobject")
Set ts = fso.OpenTextFile(tmpl)
body = ts.ReadAll
ts.Close
body = Replace(body,"{name}",name)
body = Replace(body,"{company}",company)
body = Replace(body,"{city}",city)
body = Replace(body,"{country}",country)
body = Replace(body,"{telephone}",telephone)
body = Replace(body,"{email}",email)
body = Replace(body,"{details}",details)
Set objMail = CreateObject("CDONTS.NewMail")
objMail.MailFormat = 0
objMail.BodyFormat = 0
objMail.To = "sales@canadamotorcredit.com"
objMail.From = Email
objMail.Subject = "Contact Form"
objMail.Body = body
objMail.send
set objMail = nothing
response.redirect ("contactthnks.asp")
end if
end if
%>