Hi, Joey.
The biggest problem I've seen when using an smtp server to send emails
is that the connection limit is easily surpassed because the system can
create emails faster than they can be sent out.
That causes a bit of unreliability and choking.
I've seen good results, and almost perfect reliability, when a little
delay is introduced to allow the number of connections to be lowered.
This little piece of code might be of help ::
if( connectionLimit != -1
&& ++sentCount >= connectionLimit ) {
System.Threading.Thread.Sleep( new TimeSpan( 0, 0, 0, 15, 0 ) );
sentCount = 0;
}
re:
> It is my understanding that these classes use CDONTS (cdosys.dll)
> and the SMTP mail service on the server to send the messages.
Windows Server 2003 does not install Collaboration Data Objects (CDO)
for NTS (CDONTS). Therefore, applications that use CDONTS do not
function on a Windows Server 2003-based computer.
Actually, the System.Web.Mail namespace provides a managed wrapper
for CDOSYS. The System.Web.Mail namespace is only available in
..NET Framework applications.
re:
"could not access CDO.Message"
What is your OS ?
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaņol
Ven, y hablemos de ASP.NET...
======================
"Joey" <> wrote in message
news: oups.com...
>I am currently developing a C# asp.net application where users are
> required to register. The application then generates a simple, plain
> text email and sends it to the new user.
>
> I have been trying to use the MailMessage and SmtpMail classes from the
> System.Web.Mail namespace (built in to .net) to do this. It is my
> understanding that these classes use CDONTS (cdosys.dll) and the SMTP
> mail service on the server to send the messages. Messages are generated
> and then placed in the "Queued" folder under the SMTPRoot folder in
> IIS. The SMTP server service does the rest...
>
> The problem I am having is that this method appears to be extremely
> unreliable, at best. Sometimes the message will send, and sometimes I
> get a "could not access CDO.Message" exception/error. After searching
> for this on usenet, I have also discovered that this problem appears to
> be very common. The only solution I can find is to reboot the
> service/server (and that doesn't always work!)
>
> Anyways, this is clearly not going to work in a production environment,
> so I need to do something about it.
>
> I would like to know if anyone has any suggestions on what I might do
> to improve performance and reliability when trying to send emails from
> my asp.net application. Are there better options to use for this (i.e.
> 3rd party components or tools?) If so, what would you recommend, and
> why?
>
> Thanks in advance for your help!
>