By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,333 Members | 1,843 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,333 IT Pros & Developers. It's quick & easy.

CDO.Message.1 (0x80040213) The transport failed to connect to the server.

P: 1
hi all,
i am newbie here. i was trying to send mail from ASP, but i encountered the error as below:-

CDO.Message.1 (0x80040213) The transport failed to connect to the server.

i already google about the error and tried to fix error, but seems like the error unable to solve.
Hope that someone can help me with the error. thanks a lot in advance.
below are the codes that i applied....
Expand|Select|Wrap|Line Numbers
  1. <!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"  NAME="CDO for Windows 2000 Library" -->
  2. <!--METADATA TYPE="typelib"  UUID="00000205-0000-0010-8000-00AA006D2EA4"  NAME="ADODB Type Library" -->
  3.  
  4. <%
  5.  
  6. 'Const cdoSendUsingMethod        = _
  7. '    "http://schemas.microsoft.com/cdo/configuration/sendusing"
  8.  
  9.  
  10. Const cdoSendUsingMethod1 =  "http://schemas.microsoft.com/cdo/configuration/sendusing"  
  11.  
  12. Const cdoSendUsingPort1          = 2
  13. Const cdoSMTPServer1             = _
  14.     "http://schemas.microsoft.com/cdo/configuration/smtpserver"
  15. Const cdoSMTPServerPort1         = _
  16.     "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
  17. Const cdoSMTPConnectionTimeout1  = _
  18.     "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
  19. Const cdoSMTPAuthenticate1       = _
  20.     "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
  21. Const cdoBasic1                  = 1
  22. Const cdoSendUserName1           = _
  23.     "http://schemas.microsoft.com/cdo/configuration/sendusername"
  24. Const cdoSendPassword1           = _
  25.     "http://schemas.microsoft.com/cdo/configuration/sendpassword"
  26.  
  27. Dim objConfig  ' As CDO.Configuration
  28. Dim objMessage ' As CDO.Message
  29. Dim Fields     ' As ADODB.Fields
  30.  
  31. ' Get a handle on the config object and it's fields
  32. Set objConfig = Server.CreateObject("CDO.Configuration")
  33. Set Fields = objConfig.Fields
  34.  
  35. ' Set config fields we care about
  36. With Fields
  37.     .Item(cdoSendUsingMethod1)       = cdoSendUsingPort1
  38.     .Item(cdoSMTPServer1)            = "smtp.gmail.com."
  39.     .Item(cdoSMTPServerPort1)        = 465
  40. 'gmail also    .Item(cdoSMTPServerPort1)        = 465
  41.     .Item(cdoSMTPConnectionTimeout1) = 10
  42.     .Item(cdoSMTPAuthenticate1)      = cdoBasic1
  43.     .Item(cdoSendUserName1)          = "me@gmail.com"
  44.     .Item(cdoSendPassword1)          = "xxxxxxxx"
  45.  
  46.     .Update
  47. End With
  48.  
  49. Set objMessage = Server.CreateObject("CDO.Message")
  50.  
  51. Set objMessage.Configuration = objConfig
  52.  
  53. With objMessage
  54.     .To       = "me@yahoo.com"
  55.     .From     = "me@gmail.com"
  56.     .Subject  = "SMTP Relay Test"
  57.     .TextBody = "SMTP Relay Test Sent @ " & Now()
  58.     .Send
  59. End With
  60.  
  61. Set Fields = Nothing
  62. Set objMessage = Nothing
  63. Set objConfig = Nothing
  64. %>
Nov 21 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.