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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Raahul
    New Member
    • Dec 2010
    • 1

    #1

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

    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.
    Code:
    Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"
    Const cdoSendUsingPort = 2
    Const cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
    Const cdoSMTPServerPort = "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
    Const cdoSMTPConnectionTimeout = "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
    Const cdoSMTPAuthenticate = "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
    Const cdoBasic = 1
    Const cdoSendUserName = "http://schemas.microsoft.com/cdo/configuration/sendusername"
    Const cdoSendPassword = "http://schemas.microsoft.com/cdo/configuration/sendpassword"
    
    Dim objConfig 
    Dim objMessage 
    Dim Fields 
    
    Set objConfig = CreateObject("CDO.Configuration")
    Set Fields = objConfig.Fields
    
    With Fields
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPServer) = "<smtp server>"
    .Item(cdoSMTPServerPort) = 25
    .Item(cdoSMTPConnectionTimeout) = 100
    .Item(cdoSMTPAuthenticate) = cdoBasic
    .Item(cdoSendUserName) = "<username>"
    .Item(cdoSendPassword) = "<password>"
    
    .Update
    End With
    
    Set objMessage = CreateObject("CDO.Message")
    
    Set objMessage.Configuration = objConfig
    
    With objMessage
    .To = "'Name' <Adress>"
    .from = "'Name' <Adress>"
    .Subject = "SMTP Relay Test"
    .TextBody = "SMTP Relay Test Sent @ " & Now()
    .Send
    End With
    
    Set Fields = Nothing
    Set objMessage = Nothing
    Set objConfig = Nothing
    Last edited by Niheel; Dec 6 '10, 03:59 PM. Reason: please use code tags and use a better worded title
Working...