<%
Option Explicit
dim sName, sEmail, sMessage, sPhone, sAddress
dim oCdoMail, oCdoConf, sConfURL
if Request.Form("Action") <> "" then
sName = Request.Form("Name")
sEmail = Request.Form("Email")
sPhone = Request.Form("Phone")
sAddress = Request.Form("Address")
sMessage = Request.Form("Message")
Set oCdoMail = Server.CreateObject("CDO.Message")
Set oCdoConf = Server.CreateObject("CDO.Configuration")
sConfURL = "http://schemas.microsoft.com/cdo/configuration/"
with oCdoConf
.Fields.Item(sConfURL & "sendusing") = 4
.Fields.Item(sConfURL & "smtpserver") = "smtp.domain.com"
.Fields.Item(sConfURL & "smtpserverport") = 25
.Fields.Update
end with
with oCdoMail
.To = "[email protected]"
.From = sEmail
'.To = sEmail
.Subject = " Enquiry"
.TextBody = sMessage & vbCrLf & sPhone & vbCrLf & sEmail & vbCrLf & sAddress
'.HTMLBody = sMessage
'.HTMLBody = sEmail
'.HTMLBody = sPhone
'.HTMLBody = sAddress
.Configuration = oCdoConf
.Send
end with
Set oCdoConf = Nothing
Set oCdoMail = Nothing
response.write "Thanks for your message!"
else
%>
<%
end if
%>
|