Tuesday, August 21, 2012

Could not create 'CDO.Message' - The transport failed to connect to the server


This is an SMTP Server error. There are so many reasons for getting this error.  So you have to check the Inner Exception of this exception. One of the inner exception for this error is "The transport failed to connect to the server". If you found this error initially check the Firewall setting. The firewall might block the web mail port. Add firewall exception to the web mail port (25) .

And instead of assigning the server like
SmtpMail.SmtpServer = "127.0.0.1 or your mail server name"


Use the insert method as below
SmtpMail.SmtpServer.Insert( 0, "127.0.0.1 or your mail server name")


Some more details are available at Microsoft Support