Could not access 'CDO.Message'

Posted by Victor on May 10, 2002

We’ve been having this problem intermitently when trying to send mail from within an ASP.NET application. Today, while looking for other info on the documentation, I came across a precious nugget which has helped us solve the problem.

The thing is, the .NET framework is trying to access a mail server and is not possible to connect to it (yes, the error message is misleading). Why can’t it connect to the mail server? well, because of the proxy settings. As we have to access from time to time servers which the proxy cannot reach, we are constantly enabling and disabling the proxy. The framework also uses the proxy, and by default will connect to it using the configuration found in the Internet Options dialog box. Since we develop our apps using the local IIS server, the framework is also affected by our intermitent proxy info availability.

So, either you make sure the options are right, or (and here’s the secret) edit your machine.config file, and in the /configuration/system.net/defaultProxy node set up your preferences. You can also set a list of servers which the framework will bypass the proxy when connecting to.

Also, this option is configurable on an application level, too. More info on ms-help://MS.VSCC/MS.MSDNVS/cpgenref/html/gngrfdefaultproxyelement.htm or, if you have not the documentation installed locally, on the MSDN library.