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

How to fix "transport errror 0x80040217: message could not be sent to the SMTP . ."?

P: 1
I am using asp with vbscript.
for sending mail CDO object is used but giving transport errror 0x80040217.
But the same code is running on live in another server.
I am using the port 25,also having authentication.I am facing this problem last 10 days.Please resolve.
Expand|Select|Wrap|Line Numbers
  1. Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"
  2. Const cdoSendUsingPort = 2
  3. Const cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
  4. Const cdoSMTPServerPort = "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
  5. Const cdoSMTPConnectionTimeout = "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
  6. Const cdoSMTPAuthenticate = "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
  7. Const cdoBasic = 1
  8. Const cdoSendUserName = "http://schemas.microsoft.com/cdo/configuration/sendusername"
  9. Const cdoSendPassword = "http://schemas.microsoft.com/cdo/configuration/sendpassword"
  10.  
  11. Dim objConfig 
  12. Dim objMessage 
  13. Dim Fields 
  14.  
  15. Set objConfig = CreateObject("CDO.Configuration")
  16. Set Fields = objConfig.Fields
  17.  
  18. With Fields
  19. .Item(cdoSendUsingMethod) = cdoSendUsingPort
  20. .Item(cdoSMTPServer) = "<smtp server>"
  21. .Item(cdoSMTPServerPort) = 25
  22. .Item(cdoSMTPConnectionTimeout) = 100
  23. .Item(cdoSMTPAuthenticate) = cdoBasic
  24. .Item(cdoSendUserName) = "<username>"
  25. .Item(cdoSendPassword) = "<password>"
  26.  
  27. .Update
  28. End With
  29.  
  30. Set objMessage = CreateObject("CDO.Message")
  31.  
  32. Set objMessage.Configuration = objConfig
  33.  
  34. With objMessage
  35. .To = "'Name' <Adress>"
  36. .from = "'Name' <Adress>"
  37. .Subject = "SMTP Relay Test"
  38. .TextBody = "SMTP Relay Test Sent @ " & Now()
  39. .Send
  40. End With
  41.  
  42. Set Fields = Nothing
  43. Set objMessage = Nothing
  44. Set objConfig = Nothing
Dec 4 '10 #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.