%
Function SendMail(from,toMail,subject,bodytext)
Dim strFrom, strSubject, strBody, stremail 'Strings for fromaddress, subject, body
Dim objCDOMail 'The CDO object
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
''''''''to change on upload
With cdoConfig.Fields
.Item(sch & "smtpauthenticate") = 2
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "Your server ip address" 'Like 192.168.0.598
.Item(sch & "smtpserverport") = 25
.Item(sch & "smtpusessl") = false
.update
End With
'First we'll read in the values entered
strFrom = from
strSubject = subject
strBody = bodytext
stremail=toMail
' Create an instance of the NewMail object.
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = cdoConfig
' Set the properties of the object
objMessage.From = strFrom
objMessage.To = stremail
objMessage.Subject = strSubject
objMessage.htmlBody = strBody
objMessage.Send
Set objMessage = Nothing
End Function
if request.Form("send")="YES" then
body = "Following Message/Query has been placed from Hybrid Mixed Martial Arts Website.
"
body = body & "Name : " & request.Form("name") & " "
body = body & "Tel No : " & request.Form("telno") & " "
body = body & "Email : " & request.Form("email") & " "
body = body & "Comments : " & request.Form("comments") & " "
body = body & "Keep this email safe for future references.
"
body = body & "Kind Regards,
Hybrid Mixed Martial Arts Tel: 01752 298836 Tel: 07717791314"
toMail = "info@hybridmixedmartialarts.co.uk"
fromMail = "info@hybridmixedmartialarts.co.uk"
subjectMail = "Contact Us Query from Hybrid Mixed Martial Arts Website"
bodyMail = body
SendMail(fromMail, toMail, subjectMail, bodyMail)
message = "Your Query has been posted successfuly to Hybrid Mixed Martial Arts"
end if
%>
Hybrid Mixed Martial Arts
<%
if message<>"" then
response.Write(""&message&"")
end if
%>