471,082 Members | 906 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,082 software developers and data experts.

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

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
0 2442

Post your reply

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

Similar topics

2 posts views Thread by Mike Obiku | last post: by
2 posts views Thread by Chris Pearson | last post: by
5 posts views Thread by Bruce Schechter | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.