Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Help! Sending Emails From asp.net Application

Reply
Thread Tools

Help! Sending Emails From asp.net Application

 
 
Joey
Guest
Posts: n/a
 
      07-27-2005
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!

 
Reply With Quote
 
 
 
 
Ben Amada
Guest
Posts: n/a
 
      07-27-2005
Joey wrote:

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


I've heard good things about aspNetEmail (haven't tried it myself though):

http://www.aspnetemail.com/

Good luck,
Ben


 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      07-27-2005
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!
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Scanning my emails for harmfull emails etc lee.ingram Computer Support 4 01-12-2006 01:21 AM
Cisco 1720, problem sending emails (SMTP) Asam Cisco 1 10-13-2005 12:21 PM
How to stop Sir name showing on emails from hotmail emails Drifter Computer Information 3 07-07-2004 07:15 AM
Re: Sending multiple emails (1000+) using dotnet Wim Hollebrandse ASP .Net 0 08-19-2003 12:22 PM
Re: Sending multiple emails (1000+) using dotnet Natty Gur ASP .Net 0 08-19-2003 10:13 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57