Could not create 'CDO.Message' object

A

Alain

Hi,

I am trying to figure out why I get the following error when I try to send
a mail from an ASP.NET (1.1) application. When I use the same code from a
Windows exe then the code works perfectly, so I suppose that is has something
to do with security settings for IIS or SMTP Server.

Can anybody help me, because I am getting desperate. I have also looked it
up on the web but I get a lot of stuff that I have tried but none of the
solutions helped.

Code:
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send("(e-mail address removed)", "(e-mail address removed)", "Test", "Test");

Exceprion information:
System.Web.HttpException: Could not create 'CDO.Message' object. at
System.Web.Mail.LateBoundAccessHelper.get_LateBoundType() at
System.Web.Mail.LateBoundAccessHelper.CreateInstance() at
System.Web.Mail.CdoSysHelper.Send(MailMessage message) at
System.Web.Mail.CdoSysHelper.Send(String from, String to, String subject,
String messageText) at
System.Web.Mail.SmtpMail.Send(String from, String to, String subject, String
messageText) at
Test.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\projects\test\webform1.aspx.cs:line 28
 
S

sloan

Check my blog:
http://spaces.msn.com/sholliday/ 2/8/2006 entry

I have code for the different authentication methods pre-packaged.

Also.

Check your wwwroot/email/queue (I think thats the one(?)).... and see if
items are getting stuck there.

if so, do a google search for "smart host"
 
A

Alain

Hello,

I have experimented some more but I can't even get mails send to localhost.
I should expect that they are dropped in the queue folder but the only thing
I get (even when using SmtpMail.SmtpServer.Insert(0, "localhost")) is that
annoying error message "Could not create 'CDO.Message' object".

On the PC of my co-worker the code works fine and when I use a windows exe.
Maybe there is a configuration issue. I am getting pretty tired of it!
 
A

Alain

Hello Stuart,

I even tried this solution from Microsoft Support and it dodn't work for me:

This is the response i received from Microsoft:

Thank you for contacting Microsoft Developer Support. My name is Duke, and
I will be assisting you with this Service Request. In your case, you've indicated
you met the error "Could not create 'cdo.message' object" while using the
System.Web.Mail.SmtpMail object to send mail. You try to re-register the
file cdosys.dll but failed with the error 0x800704da. We shall be working
to resolve this specific issue through the course of the case. If I have
misunderstood your concern, please let me know. Based on my research and
experience, there are several versions of CDO, which may not be able to coexist
on the same machine. For more details regarding the CDO versions, please
refer to:

Title: Collaboration Data Objects Roadmap
URL: http://msdn.microsoft.com/library/en-us/dncdsys/html/cdo_roadmap.asp
In order to resolve the issue, you can find the CDO file current registered,
un-register it, and then re-register the file CDOSYS.DLL.

In order to find/un-register the CDO file current registered, you may refer
to the following steps:

1. Launch Regedt32.exe from “Start†-> “Runâ€.
2. Navigate to HKEY_CLASSES_ROOT\CDO.xxxxxx (CDO.xxxxxx represents a
registry item, i.e. CDO.Address), copy down the default value of the key
CLSID (i.e. {CD000110-8B95-11D1-82DB-00C04FB1625D}).
3. Navigate to HKEY_CLASSES_ROOT\CLSID\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
(Note: {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} represents the value got in
step 2.)
4. The default value of the sub-key “InprocServer32†is the path of
the target file.
5. Un-register the file with the command line “Regsvr32 -u xxxxx.dllâ€.

After un-registering the file, you can try to register the file CDOSYS.DLL
again, and it should work fine.

If you have any concerns regarding the above, please feel free to contact
me. I’ll be glad to be of assistance.
 
C

Christopher Reed

Is the ASP.NET application also running on your local machine? If not, then
the SMTP server in question is the computer that is hosting the ASP.NET app.
This would be different from an EXE which would be using the client's SMTP
server.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top