Thursday, March 22, 2012

SmtpMail.Send and application stuck

Hi,
I have a web application that sends Email on certain events.
The problem is that sometimes the local mail server does not response to
SmtpMail.Send and all the web application in stucked so the user can not
browse anymore.
I thought that a possible solution is to send the Email in new thread so the
application will continue to work also when the mail server is down.
What's the easiest way to accomplish this ?
Anyone has an example for that ?

Thanks
ra294@dotnet.itags.org.hotmail.comuse a queue for messages, and have background thread pick it up. this won't
solve the thread hanging. a simpler approach would to be create a command
line tool to do the send. you website would then just spawn it. the command
line tool could use a timer to kill itself to catch a hang.

-- bruce (sqlwork.com)

"ra294" <ra294@.hotmail.com> wrote in message
news:%23bR%23p$bnFHA.3448@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I have a web application that sends Email on certain events.
> The problem is that sometimes the local mail server does not response to
> SmtpMail.Send and all the web application in stucked so the user can not
> browse anymore.
> I thought that a possible solution is to send the Email in new thread so
> the application will continue to work also when the mail server is down.
> What's the easiest way to accomplish this ?
> Anyone has an example for that ?
> Thanks
> ra294@.hotmail.com

0 comments:

Post a Comment