473,499 Members | 1,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Could not access 'CDO.Message' object

Hi,

I'm using the System.Web.Mail class to send an e-mail from my ASP.Net
application, but when sending the e-mail, I'm getting the above error. It
seems to be because I have Office XP installed, and the version of CDO is
replaced by this installation. I haven't been able to find this error
anywhere on any MS site. Anyone have a clue on how to then actually send the
e-mail?

Thanks

Thys Brits
MCSD/MCAD
Jul 21 '05 #1
4 9259
Hi Thys,

Have you ever sent e-mail successfully with System.Web.Mail class before
you installed the Office XP?
Can you tell me if your smtp server used to send email need client
authentication, which may caused the problem, Since you can not set the
client authentication with the System.Web.Mail class?
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Thys Brits" <th**@jtsoftware.co.za>
Subject: Could not access 'CDO.Message' object
Date: Sun, 21 Sep 2003 17:57:41 +0200
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <O1**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: c5-pta-49.dial-up.net 196.33.244.49
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:109325
X-Tomcat-NG: microsoft.public.dotnet.general

Hi,

I'm using the System.Web.Mail class to send an e-mail from my ASP.Net
application, but when sending the e-mail, I'm getting the above error. It
seems to be because I have Office XP installed, and the version of CDO is
replaced by this installation. I haven't been able to find this error
anywhere on any MS site. Anyone have a clue on how to then actually send thee-mail?

Thanks

Thys Brits
MCSD/MCAD


Jul 21 '05 #2
Hi,

I added a reference to Microsoft CDO for Exchange library in my project, and
changed the code to use CDO.MessageClass (and had to change a few
properties, including the Configuration.Fields). This works, although there
are no authentication properties set. I'm using my local SMTP server, and it
worked using the code below (the code is run in a web server control):

CDO.MessageClass mail = new CDO.MessageClass();
mail.Subject = "Record change";
mail.From = "te**@test.co.za)";
mail.HTMLBody = "<HTML><Body><Font Face=\"Arial\" Size=\"2\">";
mail.HTMLBody += "A change has been made to a record in the table <b>" +
strTable + "</b> by " + this.Page.Session["UserName"] + ".<br>";
string sURL = this.Page.Request.Url.ToString();
mail.HTMLBody += "<p>To view the change(s), visit the website at <A href=\""
+ sURL + "\">" + sURL + "</a>.";
mail.HTMLBody += "</Font></Body></HTML>";
mail.BCC = "te**@test.co.za";
mail.To = recip.Substring(0, recip.Length - 1); //recip is a string
containing all the recipients
mail.Configuration.Fields["http://schemas.microsoft.com/cdo/configuration/se
ndusing"].Value = 2;
mail.Configuration.Fields["http://schemas.microsoft.com/cdo/configuration/sm
tpserverport"].Value = 25;
if(this.Page.Application["MailServer"] != null)
{

mail.Configuration.Fields["http://schemas.microsoft.com/cdo/configuration/sm
tpserver"].Value = this.Page.Application["MailServer"].ToString();
}
mail.Configuration.Fields.Update();
mail.Send();

I haven't tried sending mail before installing Office XP, the only reason I
thought it might be this, is because I found an article on MS website saying
that Office XP replaces the CDO library, and replaces the reference to it in
the registry. Any further ideas?

Thys Brits

PS - I should warn everyone - don't post with your real e-mail address -
since posting my original message, I've been spammed with these stupid
"Microsoft Update" virus e-mails - I've received about 30 in the last 18
hours.... MS should find these people and sue them for identity theft, etc,
etc, etc....

"Peter Huang [MSFT]" <v-******@online.microsoft.com> wrote in message
news:Pq**************@cpmsftngxa06.phx.gbl...
Hi Thys,

Have you ever sent e-mail successfully with System.Web.Mail class before
you installed the Office XP?
Can you tell me if your smtp server used to send email need client
authentication, which may caused the problem, Since you can not set the
client authentication with the System.Web.Mail class?
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Thys Brits" <th**@jtsoftware.co.za>
Subject: Could not access 'CDO.Message' object
Date: Sun, 21 Sep 2003 17:57:41 +0200
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <O1**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: c5-pta-49.dial-up.net 196.33.244.49
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:109325
X-Tomcat-NG: microsoft.public.dotnet.general

Hi,

I'm using the System.Web.Mail class to send an e-mail from my ASP.Net
application, but when sending the e-mail, I'm getting the above error. It
seems to be because I have Office XP installed, and the version of CDO is
replaced by this installation. I haven't been able to find this error
anywhere on any MS site. Anyone have a clue on how to then actually send

the
e-mail?

Thanks

Thys Brits
MCSD/MCAD

Jul 21 '05 #3
For those of you who were wondering about this, I found the solution. It's a
permissions problem. I added the following code at the top of my class, and
it worked!

using System.Security.Permissions;
[assembly:PermissionSetAttribute(SecurityAction.Req uestMinimum, Name =
"LocalIntranet")]

Thys Brits
MCSD/MCSD.Net

"Thys Brits" <th**@jtsoftware.co.za> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi,

I added a reference to Microsoft CDO for Exchange library in my project, and changed the code to use CDO.MessageClass (and had to change a few
properties, including the Configuration.Fields). This works, although there are no authentication properties set. I'm using my local SMTP server, and it worked using the code below (the code is run in a web server control):

CDO.MessageClass mail = new CDO.MessageClass();
mail.Subject = "Record change";
mail.From = "te**@test.co.za)";
mail.HTMLBody = "<HTML><Body><Font Face=\"Arial\" Size=\"2\">";
mail.HTMLBody += "A change has been made to a record in the table <b>" +
strTable + "</b> by " + this.Page.Session["UserName"] + ".<br>";
string sURL = this.Page.Request.Url.ToString();
mail.HTMLBody += "<p>To view the change(s), visit the website at <A href=\"" + sURL + "\">" + sURL + "</a>.";
mail.HTMLBody += "</Font></Body></HTML>";
mail.BCC = "te**@test.co.za";
mail.To = recip.Substring(0, recip.Length - 1); //recip is a string
containing all the recipients
mail.Configuration.Fields["http://schemas.microsoft.com/cdo/configuration/se ndusing"].Value = 2;
mail.Configuration.Fields["http://schemas.microsoft.com/cdo/configuration/sm tpserverport"].Value = 25;
if(this.Page.Application["MailServer"] != null)
{

mail.Configuration.Fields["http://schemas.microsoft.com/cdo/configuration/sm tpserver"].Value = this.Page.Application["MailServer"].ToString();
}
mail.Configuration.Fields.Update();
mail.Send();

I haven't tried sending mail before installing Office XP, the only reason I thought it might be this, is because I found an article on MS website saying that Office XP replaces the CDO library, and replaces the reference to it in the registry. Any further ideas?

Thys Brits

PS - I should warn everyone - don't post with your real e-mail address -
since posting my original message, I've been spammed with these stupid
"Microsoft Update" virus e-mails - I've received about 30 in the last 18
hours.... MS should find these people and sue them for identity theft, etc, etc, etc....

"Peter Huang [MSFT]" <v-******@online.microsoft.com> wrote in message
news:Pq**************@cpmsftngxa06.phx.gbl...
Hi Thys,

Have you ever sent e-mail successfully with System.Web.Mail class before
you installed the Office XP?
Can you tell me if your smtp server used to send email need client
authentication, which may caused the problem, Since you can not set the
client authentication with the System.Web.Mail class?
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: "Thys Brits" <th**@jtsoftware.co.za>
Subject: Could not access 'CDO.Message' object
Date: Sun, 21 Sep 2003 17:57:41 +0200
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <O1**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: c5-pta-49.dial-up.net 196.33.244.49
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:109325
X-Tomcat-NG: microsoft.public.dotnet.general

Hi,

I'm using the System.Web.Mail class to send an e-mail from my ASP.Net
application, but when sending the e-mail, I'm getting the above error. Itseems to be because I have Office XP installed, and the version of CDO isreplaced by this installation. I haven't been able to find this error
anywhere on any MS site. Anyone have a clue on how to then actually
send the
e-mail?

Thanks

Thys Brits
MCSD/MCAD


Jul 21 '05 #4
senani28
1 New Member
Hi , can somebody tell me the solution for VB.NET
Jul 3 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
91013
by: Janna Deegan | last post by:
Hello all, First off, if there is a better place to post for an answer to this question, please feel free to point me there. I have some very strange behavior happening with my System.web.mail...
2
7252
by: Desmond | last post by:
Hi, I would really appreciate if somebody could give some advise on this. I've a ASP.NET application that is supposed to send emails and it is tested to be working well on IIS 5.0 and tested...
1
2687
by: Jens Øster | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
3
9241
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
1
2422
by: Michael | last post by:
Hello, I've read a lot of threads on this subject, but they typically go back to a problem with the smtp server configuration. In my case, everything works great until I uncomment the one line...
4
3956
by: Liz Patton | last post by:
Here's the exception: System.Exception: Unable to send mail: Could not access 'CDO.Message' object. ---> System.Web.HttpException: Could not access 'CDO.Message' object. --->...
2
372
by: MattB | last post by:
I've taken some working code from a vb clas library that was a part of a web application and put it into a stand alone class library so I can reuse it from other applications. I'm using some code...
3
2562
by: Anthony Fine | last post by:
Hello All, I have a VB.Net app that needs to send mail. I have created a class for building my e-mail, but keep getting the error (Could not access 'CDO.Message' object.) when trying to send...
3
356
by: Thys Brits | last post by:
Hi, I'm using the System.Web.Mail class to send an e-mail from my ASP.Net application, but when sending the e-mail, I'm getting the above error. It seems to be because I have Office XP...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7388
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4600
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.