Could not access 'CDO Message' object.  
Author Message
kellynn





PostPosted: Mon Oct 25 06:28:48 CDT 2004 Top

Visual Basic [VB] >> Could not access 'CDO Message' object.

Hello,
I have created an application that issues a SQL statement, writes the
resulting rows into an Excel spreadsheet and then emails that spreadsheet as
an attachment to our customers. I want this to run daily and completely
unattended.

This works fine in XP where I developed it, but when I move the code to our
Win2K server, it chokes with the following message.
Could not access 'CDO Message' object.

This was built with .NET 1.1 with all service paks installed. It is in VB
and the actual snippet of code that fails is as follows:

Dim msg as new System.Web.mail.MailMessage
Dim atch as new System.Web.mail.MailAttachment("myExcel.wks")
Try
msg.<add all the required message stuff such as: to, from, bcc, subject,
and body>
msg.Attachments.Add(atch)

SmtpMail.SmtpServer = "my.mailserver.mail.com"
SmtpMail.Send(msg)
MessageBox.Show("It works!")
Catch ex as Exception
MessageBox.Show(ex.Message)
EndTry

I do not get the message box that it works, I only get the above mentioned
message.

I read some posts on Google and from that I gathered that sometimes the
cdosys.dll needs to be re-registered, so I found it in my System32 dir and
did a regsvr32 on it, That indicated success, but it did not solve my
problem.

This works just fine on my XP Pro development box using exactly the same
mail server.

Help!!!

Tim Reynolds


Visual Studio120  
 
 
Herfried





PostPosted: Mon Oct 25 06:28:48 CDT 2004 Top

Visual Basic [VB] >> Could not access 'CDO Message' object.
> This works fine in XP where I developed it, but when I move the
> code to our Win2K server, it chokes with the following message.
> Could not access 'CDO Message' object.

Did you already take a look at <URL:http://www.systemwebmail.com/>?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


 
 
CT





PostPosted: Tue Oct 26 04:15:35 CDT 2004 Top

Visual Basic [VB] >> Could not access 'CDO Message' object. Tim,

It could be due to relay permissions. Try adding the client machine with
relay permissions on the server.

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105


> Hello,
> I have created an application that issues a SQL statement, writes the
> resulting rows into an Excel spreadsheet and then emails that spreadsheet
> as
> an attachment to our customers. I want this to run daily and completely
> unattended.
>
> This works fine in XP where I developed it, but when I move the code to
> our
> Win2K server, it chokes with the following message.
> Could not access 'CDO Message' object.
>
> This was built with .NET 1.1 with all service paks installed. It is in VB
> and the actual snippet of code that fails is as follows:
>
> Dim msg as new System.Web.mail.MailMessage
> Dim atch as new System.Web.mail.MailAttachment("myExcel.wks")
> Try
> msg.<add all the required message stuff such as: to, from, bcc,
> subject,
> and body>
> msg.Attachments.Add(atch)
>
> SmtpMail.SmtpServer = "my.mailserver.mail.com"
> SmtpMail.Send(msg)
> MessageBox.Show("It works!")
> Catch ex as Exception
> MessageBox.Show(ex.Message)
> EndTry
>
> I do not get the message box that it works, I only get the above mentioned
> message.
>
> I read some posts on Google and from that I gathered that sometimes the
> cdosys.dll needs to be re-registered, so I found it in my System32 dir and
> did a regsvr32 on it, That indicated success, but it did not solve my
> problem.
>
> This works just fine on my XP Pro development box using exactly the same
> mail server.
>
> Help!!!
>
> Tim Reynolds

>
>