%
if request("ProcessThisForm") = "Y" then
'Form the HTML and send the email.
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 & ""
'response.Write(sHTML)
session("emailRecipient") = "scott@mcevoythomas.com.au" 'THIS NEEDS TO BE CHANGED TO WHOEVER IS TO RECEIVE THE EMAIL
session("emailSender") = "website@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.write("")
response.write("")
end if
%>
COntact Us about data security, wireless security and messaging security solutions, Sydney.
<%
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
%>