Hello,
I have an ASP page that sends emails using CDO objects using HMail server and SSL.
However, when I try to send an email, I get a '80040213 the transport failed to connect to the server'. I do not know what I am doing wrong.
The code of the CDO message is below:
If
request.Form("submit") <>
""
thenSet
myMail=CreateObject("CDO.Message")
myMail.Subject=
"Contact Request"
myMail.From=Request.Form(
"email")
myMail.To=
"xxxxxx"
myMail.Textbody =
"Name:"& Request.Form("name")&
vbcrlf & vbcrlf & _
"Email:" & Request.Form("email")
& vbcrlf & vbcrlf & _
"Telephone:" & Request.Form("telephone")
& vbcrlf & vbcrlf & _
"Location:" & Request.Form("location")
& vbcrlf & vbcrlf & _
"Other location:" & Request.Form("other_location")
& vbcrlf & vbcrlf & _
"Comments:" & Request.Form("comments")
myMail.Configuration.Fields.Item _
(
"http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
(
"http://schemas.microsoft.com/cdo/configuration/smtpserver") _
=
"127.0.0.1"
'Server port
myMail.Configuration.Fields.Item _
(
"http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=587
myMail.Configuration.Fields.Item _
(
"http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
myMail.Configuration.Fields.Item _
(
"http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 120
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing