473,402 Members | 2,055 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,402 software developers and data experts.

CDO.Message Error

Hello,

We're developing a small SMTP client application. When
we run the program we get the following error message:

"could not access 'CDO.Message' object"

We get the error message when we set the
"SmtpMail.SmtpServer" value. However, if
we don't specify the server name we don't
receive the email message either.

// C# source code snippet.
//

MailMessage mm = new MailMessage();

mm.From = "su*****@mycompany.com";
mm.To = "te*******@mycompany.com";
mm.Cc = "";
mm.Bcc = "";
mm.Subject = "Test Subject";
mm.Body = "Test Body";

SmtpMail.SmtpServer = "mycompany.com";

SmtpMail.Send(mm);

// end of code snippet

Any ideas about what could be causing the error message?

TIA,
Jacques
Nov 15 '05 #1
4 2520

Hi Jacques,

Does your application run in asp.net?
The asp.net account may not have the enough privilege to access the network
an create sockets.
It DOES, however, have privileges to create a socket to the local machine
(127.0.0.1 localhost).
If you plan on using SmtpMail from an ASP.NET app, you MUST use your local
SMTP Service, and not an external one.
Alternatively, you could increase the privileges of the ASPNET account

or does your application multithread?
If it is multithreading, your mail code should run in the main form thread.

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Jacques Cooper" <jc*****@jcsoftware.net>
| Subject: CDO.Message Error
| Date: Mon, 3 Nov 2003 21:34:38 -0800
| Lines: 36
| 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: <Oe**************@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: omega.jcsoftware.net 66.15.15.165
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:196511
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hello,
|
| We're developing a small SMTP client application. When
| we run the program we get the following error message:
|
| "could not access 'CDO.Message' object"
|
| We get the error message when we set the
| "SmtpMail.SmtpServer" value. However, if
| we don't specify the server name we don't
| receive the email message either.
|
| // C# source code snippet.
| //
|
| MailMessage mm = new MailMessage();
|
| mm.From = "su*****@mycompany.com";
| mm.To = "te*******@mycompany.com";
| mm.Cc = "";
| mm.Bcc = "";
| mm.Subject = "Test Subject";
| mm.Body = "Test Body";
|
| SmtpMail.SmtpServer = "mycompany.com";
|
| SmtpMail.Send(mm);
|
| // end of code snippet
|
| Any ideas about what could be causing the error message?
|
| TIA,
| Jacques
|
|
|

Nov 15 '05 #2
Hello Jeffrey,

Thank you for responding to my posting. However, we are not using ASP.NET.
This is a stand-alone C# application.

Any ideas?

Thanks,
Jacques
Nov 15 '05 #3

Hi Jacques,

Thanks for your feedback.
Is your smtp server on your machine or on remote machine?
I think you can try to setup a smtp server on your machine. In your
application, if you do not specify the smtpserver, the .Net will search the
smtp service on your machine.
If your application can send the email through your machine's smtp service,
I think you should check whether your remote smtp server support this
feature.
Also, you can check the permission of C:\Inetpub\mailroot.

Actually, there are a lot of possible reason for this error message. The
link below contains a lot of discussion about this error, you can check it:
http://www.dotnetforums.net/t69426.html

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Jacques Cooper" <jc*****@jcsoftware.net>
| References: <Oe**************@TK2MSFTNGP11.phx.gbl>
<uD**************@cpmsftngxa06.phx.gbl>
| Subject: Re: CDO.Message Error
| Date: Tue, 4 Nov 2003 06:29:48 -0800
| Lines: 11
| 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: <Oa**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: omega.jcsoftware.net 66.15.15.165
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:196593
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hello Jeffrey,
|
| Thank you for responding to my posting. However, we are not using ASP.NET.
| This is a stand-alone C# application.
|
| Any ideas?
|
| Thanks,
| Jacques
|
|
|

Nov 15 '05 #4
Try putting a try catch round your code, Then print Exception.ToString()
With the SMTP exceptions, the message allways says "could not access
'CDO.Message' object", but if you do a Exception.ToString(), it gives you
more detail
Gary
"Jacques Cooper" <jc*****@jcsoftware.net> wrote in message
news:Oe**************@TK2MSFTNGP11.phx.gbl...
Hello,

We're developing a small SMTP client application. When
we run the program we get the following error message:

"could not access 'CDO.Message' object"

We get the error message when we set the
"SmtpMail.SmtpServer" value. However, if
we don't specify the server name we don't
receive the email message either.

// C# source code snippet.
//

MailMessage mm = new MailMessage();

mm.From = "su*****@mycompany.com";
mm.To = "te*******@mycompany.com";
mm.Cc = "";
mm.Bcc = "";
mm.Subject = "Test Subject";
mm.Body = "Test Body";

SmtpMail.SmtpServer = "mycompany.com";

SmtpMail.Send(mm);

// end of code snippet

Any ideas about what could be causing the error message?

TIA,
Jacques

Nov 15 '05 #5

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

Similar topics

2
by: afreema | last post by:
We have a WebSphere application that quit working this week. It was trying to hit DB2 UDB Version 8 on Linux. The Driver is DB2 V7. This is the message in the WebSphere logs. Does anyone know...
8
by: Steve | last post by:
I have several pairs of synchronized subforms in an application. I have a Delete button for each pair that uses the following code or similar to delete a record in the second subform: ...
3
by: Rolan | last post by:
I seem to be unable to have a custom error message to appear for Error 10011 (database was unable to append all the data to the table). Each time, the MS Access default error message box appears....
7
by: Leon Shaw | last post by:
Someone please help me understand the following error message: Server Error in '/solo' Application. ---------------------------------------------------------------------------- ---- ...
3
by: Robert | last post by:
Every time I navigate to any .aspx file on my computer, I get the error below. According to MSDN this indicates that my CLR is corrupt, but I've re-installed the .NET framework with no help. Also...
9
by: JTrigger | last post by:
When I compile my project using the IDE on a development machine it works just fine. When I compile it on the server using csc.exe, I get the following error when I try to bring it up in the web...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
5
by: Bruce Schechter | last post by:
I just started to develop an ASP.NET application in vs.net 2003 . But each time I try to execute the application (which is basically empty so far), I get a dialog box titled "Microsoft Development...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
8
by: g_man | last post by:
I am trying trap Runtime error 3022 (duplicates) in the click event of a command button that closes the form. I have code in the Form_Error event that does a good job of providing a more meaningful...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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 project—planning, coding, testing,...

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.