%
if request("ProcessThisForm") = "Y" then
dim sHTML
sHTML = "
"
sHTML = sHTML & "Your Name : " & request.Form("YourName")
sHTML = sHTML & "
Your Phone : " & request.Form("YourPhone")
sHTML = sHTML & "
Your Email : " & request.Form("YourEmail")
sHTML = sHTML & "
Additional Comments : " & request.Form("Message")
sHTML = sHTML & ""
'session("emailRecipient") = "scott@mcevoythomas.com.au" 'THIS NEEDS TO BE CHANGED TO WHOEVER IS TO RECEIVE THE EMAIL
session("emailRecipient") = "scott@mcevoythomas.com.au"
session("emailSender") = "web_inquiry@mcevoythomas.com.au"
session("emailSubject") = "This is an online enquiry from the MT website."
session("emailBody") = sHTML
SendEmail()
'Send an Email to the Enquirer if they have checked the box.
if request("chkSendCopy") = "on" then
session("emailRecipient") = request.Form("YourEmail")
session("emailSender") = "scott@mcevoythomas.com.au"
session("emailSubject") = "Your online enquiry from McEvoy Thomas."
session("emailBody") = sHTML
SendEmail()
end if
response.Redirect("http://www.surfcontrol.com/freetrialdownload.aspx")
end if
%>
Download Form - McEvoy Thomas
<%
'THIS PART IS WHAT CHECKS WHETHER IT HAS BEEN SUBMITTED USING THE HIDDEN FIELD and SEND THE EMAIL
sub SendEmail()
'FUNCTION THAT SENDS THE EMAIL
on error resume next
'Replace the ; with a comma
while instr(1,session("emailRecipient"),";")
session("emailRecipient") = replace(session("emailRecipient"),";",",",1,1)
wend
err.Clear
'Send by using the port on an SMTP server.
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
set imsg = createobject("cdo.message")
set iconf = createobject("cdo.configuration")
Set Flds = iConf.Fields
With Flds
'PRODUCTION
'.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "central"
'DEVELOPMENT
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "mailout@easywebdesign.com.au"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "easyweb"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.easywebdesign.com.au"
.Update
'call DisplayError()
End With
With iMsg
Set .Configuration = iConf
.To = session("emailRecipient")
.From = session("emailSender")
.Subject = session("emailSubject")
.HTMLBody = session("emailBody")
.Send
'call DisplayError()
End With
'Clear these session variables
session("emailRecipient") = ""
session("emailSender") = ""
session("emailSubject") = ""
session("emailBody") = ""
err.Clear
on error goto 0
end sub
%>