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
|
|
|