473,385 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 9248
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
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
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
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
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
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
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
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
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
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.