CDO email error - traport failed to connect the server

musicgold

New member
Local time
Today, 06:20
Joined
Dec 7, 2009
Messages
6
Hi,



Please see the following code I am trying to use to send a simple email. I am getting the following error message: Run-time error '-2147220973 (80040213)' The transport failed to connect the server. What could be the problem?


Code:
[SIZE=3][FONT=Times New Roman]Dim objEmail, toemail, schema[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]schema = "http://schemas.microsoft.com/cdo/configuration/"[/FONT][/SIZE]
 
[SIZE=3][FONT=Times New Roman]Set objEmail = Create Object("CDO.Message")  [COLOR=red]'The space between Create and Object is on purpose. Otherwise the text editor of this forum gives an error.[/COLOR][/FONT][/SIZE]
 
[SIZE=3][FONT=Times New Roman]With objEmail[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].From = "ABCD@yahoo.com"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].To = "XYZ@yahoo.com"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Subject = "Test Mail"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Textbody = "The quick brown fox " & Chr(10) & "jumps over the lazy dog"[/FONT][/SIZE]
 
[SIZE=3][FONT=Times New Roman]With .Configuration.Fields[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Item(schema & "sendusing") = 2[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Item(schema & "smtpserver") = "smtp.mail.yahoo.com"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Item(schema & "smtpserverport") = 25[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Item(schema & "smtpauthenticate") = 1[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Item(schema & "sendusername") = "ABCD"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Item(schema & "sendpassword") = "abcd"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]End With[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Configuration.Fields.Update[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Send[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]End With[/FONT][/SIZE]

Thanks,

MG.
 
Do you have any type of firewall software installed on the PC? I.E. McAffee, Norton, etc.. if so check to see if port 25 is blocked, if it is then you will need to unblock it to send email via CDO.
 
DJkarl,

Thanks. I used the info on this page to verify if my port 25 is blocked. Unfortunately that is correct, the port is blocked.

What can I do about it?

Thanks,

MG.
 
Well if you're at home and you have a firewall blocking this port you just need to either disable the firewall, or unblock the port. How you do either of those depends on the software / hardware that is doing the blocking.

If you are on a corporate network and the port is blocked you would need to contact your IT department and request that they unblock the port for you.
 
DJkarl,

Thanks a lot. I changed the port number to 587, and it works fine now.
 

Users who are viewing this thread

Back
Top Bottom