views:

676

answers:

1

I'm working on a Classic ASP & Vbscript site that uses CDO.Message to send email in a function. I'm running into trouble with this function and am recieving the error,

CDO.Message.1 error '80040213'

The transport failed to connect to the server.

I believe it has to do with the SMTP authentication settings and the shared host we are running on. I am looking for help debugging the issue further.

Here is the main code snippet from the function,

Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields

' Set config fields we care about
With Fields
 .Item(cdoSendUsingMethod)       = cdoSendUsingPort
 .Item(cdoSMTPServer)            = "mail.<website>.com"

 '.Item(cdoSMTPServerPort)        = 25
 '.Item(cdoSMTPConnectionTimeout) = 10
 '.Item(cdoSMTPAuthenticate)      = cdoBasic
 '.Item(cdoSendUserName)          = "support"
 '.Item(cdoSendPassword)          = "password"

 .Update
End With

Set objMessage = Server.CreateObject("CDO.Message")

Set objMessage.Configuration = objConfig

With objMessage
 .To       = lEmailTo                   '"Display Name <email_address>"
 .From     = lEmailFrom                 '"Display Name <email_address>"
 .Subject  = lSubject
 .TextBody = lMessage
 .Send
End With

At first I believed it might have been with the commented lines 9-13 in the above snippet, but it appears that a previous developer commented them on purpose and that the email function was still working at some point in time. Uncommenting those lines still doesn't solve the error.

Can anyone see anything I might be missing? Does anyone know what the defaults for CDO.Configuration are and what SMTP settings this code is trying to use with our shared host? Should I first call our hosting & clarify with them?

A: 

I changed the cdoSMTPServer to localhost, all ship shape!

nrub