If your smtp mail server is on another server consider setting up smtp
virutal server on the same box as your web server (on your pc when
developing). Set the smtp virutal server to relay to the actual smtp mail
server (in win2003 virtual smtp this setting is the "smart host"). What
this will do for you is pretty much guarantee that your mail will always get
queued....as long as your web server is up and the smtp service on it is
running. The beneifit of this is that if the mail server is down or there
is a network disconnect the email will still queue locally until the mail
server is available again.
If you have the benefit of multiple mail servers you can set up your code to
round robin attempt to the different mail servers. For example, if you
attempt to send to mail server 1 and a try/catch error is raised then
attempt to send to server 2 and if server 2 is down...etc. I prefer to
attempt the local smtp server first as the general logic is that if it's
down the web site is *probably* down too. We've found, through heavy
testing, that we can actually loose some emails (they just disappear) if we
send directly to our mail server and either the email viruswall server
and/or the attempted smtp mail server is down...in some situations no error
is raised when this happens: something that took me days to prove out to
our networking staff. Yet in the same situation, if the email is queued
locally it stays queued until the mail server is up.
Don't know if that answers your question but hope it helps.
Brad
"Charlie@CBFC" <ch*****@comcast.net> wrote in message
news:uj**************@TK2MSFTNGP12.phx.gbl...
Hi:
I'm working on an e-commerce site. Using the SMTP class, my site sends
out confirmation messages. It works most of the time, but sometimes raises an
error. I need a way of making sure it goes out every time. I thought
about wrapping a try-catch handler in loop that keeps on retrying if delivery
fails. Is this a good idea? If not, what is the best way of handling
this kind of thing?
Thanks,
Charlie