Link to home
Start Free TrialLog in
Avatar of rabbits2
rabbits2

asked on

CDO.Message.1 error '80040213' The transport failed to connect to the server.

I am trying to send an email from my .asp page and I am getting this error:
CDO.Message.1 error '80040213'
The transport failed to connect to the server.
.asp, line 232

Line 232 is:
     .Send

My code on the submit page is:
Dim strSender
Dim strRecipientsName
Dim strRecipients
Dim strSubject
Dim strMessage

strRecipientsName = "me@hotmail.com"
strRecipients = Request.Form("txt_email")
strSubject = "From: " & Request.Form("txt_email") & " Picture"
strMessage = "Hello " & Request.Form("txt_query") & vbCrLf & vbCrLf
strMessage = strMessage & Request.Form("txt_query") & vbCrLf & vbCrLf
strMessage = strMessage & "You received this from : " & Request.Form("txt_email") & " " & Request.Form("txt_email")
strSender = Request.Form("txt_email")

If (("" & strSender) <> "" ) and (("" & strRecipients) <> "" ) Then

Set objMail = Server.CreateObject("CDO.Message")
With objMail
     .From = strSender
     .To = strRecipients
     .Subject = strSubject
     .HTMLBody = strMessage
     .Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
     .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "ampsrc.com"
     .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
     .Configuration.Fields.Update
     .Send
End With

Set objMail = Nothing

End

SQLINSERT = "INSERT INTO tbl_queries(name,date_applied,email,subject,query) values('" & replace(session ("name"), "'", "")& "',#" & date & "#,'" & replace(session ("email"), "'", "")& "','" & replace(session ("subject"), "'", "")& "','" & replace(session ("query"), "'", "")& "')"
objConn.execute(SQLINSERT)
Else
Response.write "There has been a prblem sending your email, please......"
End if
%>
Avatar of CWS (haripriya)
CWS (haripriya)
Flag of India image

what is your mail server address?

it should be something like mail.ampsrc.com  or smtp.ampsrc.com
ASKER CERTIFIED SOLUTION
Avatar of rabbits2
rabbits2

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
Avatar of RLUNT
RLUNT

This was great. the 'Answer' is:

SendUsing = 1
and
Flds( _
 "http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") _
  = "c:\inetpub\mailroot\pickup"

Set the pickup directory to the actual pickup  directory of your email server. In my case it was

d:\program files\exchsrvr\mailroot\vsi 1\pickup.

Sending it to c:\inetpub\mailroot\pickup won't work if your email server is not using it to pick up mail.