CDO.Mail problems

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

I've having a very boggling problem and I hope someone can help shed some
light on it.

I have and Email dll for my solution. Inside the solution two projects use
the dll. An asp.net application and a c# console application. When the dll
runs in the asp.net project it sends emails no problem. In fact I can stop
the SMTP server and let the emails pile up in the pickup folder. Its'
great, I can delete them at will, turn it on and watch them send etc. Now,
the same dll used in the console application will send the email if the SMTP
server is started BUT if the SMTP server is stopped I get: Could not access
'CDO.Message' object. Failed to connect to transport.

?? Huh ??

I'd really, really, really like to be able to send the console messages into
the pickup folder just like the asp.net messages. What's the problem here?
I've searched around and I'm not seeing anything about it. I've tried
adding the local host to the relay, network service & aspnet account to the
operators, no luck :(

Any advice is greatly appreciated!

Thanks,
Ben
 
Hello Ben,

The problem seems strange, since asp.net web application can send it but
console based application can't. The difference I can think of is the
account who is sending the email.

Could you please create a separated console based solution to send emails?

There are some other steps you can try:

Add Read/Write permmissions to Everyone on the Mailroot folder.

Change the following line in the code:
SmtpMail.SmtpServer = "127.0.0.1" to SmtpMail.SmtpServer = "Blank" which
should default to the local SMTP service.

Here are some references to MSDN:

Develop Web Applications with XML and Exchange 2000
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmes2k/htm
l/devwebapps.asp

Developing Applications for the Web Storage System and Outlook Web Access
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmes2k/htm
l/wssdevaccess.asp

304427 HOW TO: Do Basic File I/O in Visual Basic .NET
http://support.microsoft.com/?id=304427

Instead of MAPI controls, I told him to use System.Web.Mail:
314201 HOWTO: Send E-mail Programmatically with System.Web.Mail and Visual
http://support.microsoft.com/?id=314201

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
-http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
p&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Just to be sure were on the same page here, both approaches succesfully send
email when the smtp server is running. The issue is, when the smtp server
is stopped the asp.net version buffers in the pickup folder while the
console application throws a CDO.Message exception. I will try your
suggestions though.

Ben
 
This seems to be a permissions problem. We tried the read/write suggestiong
and it didn't help. Adding the account to the administrators group however
fixes everything. SMTP = off, console application email goes into the
pickup folder.

All we need now is to figure out what permission is necessary. Making the
user account an operator on the smtp server didn't seem to help a bit.
Neither did power user.
 
Seems like were going in circles here. The console application will send
email when the smtp server is on. When the smtp server is stopped the
console applicatoin crashes unless it is running as an administrative
account. I don't see what creating a different console application will do.
The one I have is working just fine.
 
Hi Ben,

Looks like you have touched on most of the issues that you can encounter
with SMTP mail. Let me make a couple of assumptions here:

I assume that you are using System.Web.Mail in your code in both the
ASP.Net application and the >net console application?

You mention that the problem only occurs when the SMTP service is not
running and the console application tries to send mail..

I Have a couple of suggestions there but there is one additional thing that
we need to determine, what version OS are you running the code and the SMTP
server on? Are they both the same machine or are we also trying to send
via port? It sounds as if the code is running on the same machine as the
SMTP server.

Here's a couple of things that we can try:
Run filemon on the machine, just to see if we are getting any permissions
errors on the pickup folder, I doubt it, but better safe then sorry.
- You can of course get filemon from http://www.sysinternals.com
You do mention that adding the account to the administrators group seemed
to resolve the issue. If that is the case, I would really look at this KB
article, which may be the issue that you are seeing:

816789 Read Access to the Everyone Group Is Removed After You Install
Exchange
http://support.microsoft.com/?id=816789

It discusses problem with access to the IIS metabase, this also applies if
this is an Windows 2000 server with the latest service packs and updates.

I hope this helps, please let me know your progress and if you encounter
any issues.

Thank you,
Jeff Garman

Microsoft Developer Support (Messaging Technologies)

This posting is provided "AS IS", with no warranties, and confers no rights.
 
Back
Top