This may have more to do with your e-mail server, or the security model used
by your server, than with the .Net framework. The SMTP protocol is fairly
simple and assuming you aren't sending anything that requires translation on
the sending side (from HTML to text, for example), then the sending process
itself is pretty quick.
If it is a security model issue, then you should be paying that price only
once for each attempt to send. For example, if it takes 20 seconds to log
in, and 1 second to send an e-mail, then your code should take 21 seconds to
send one email, and 30 seconds to send 10 emails. Make sure that this is
the case by testing your sending mechanism.
Regardless, you shouldn't be holding up the web page to send 1000 emails.
Note that there is an open source SMTP server on CodeProject (I don't know
much about it, though). I'm sure that it is not the only one. Perhaps that
may be a better option than writing an expensive component.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"tparks69" <tp******@discussions.microsoft.comwrote in message
news:5C**********************************@microsof t.com...
>I have a web page that at the click of a button must send a bunch (1000+)
emails. Each email is sent individually. I have the code working fine,
using Mail Message classes and smtp and all that. But sometimes even when
I'm just sending one e-mail the web page takes a minutes or so to post.
Can
anyone tell me why it is so slow, or how to fix the problem?
To address this I am thinking of just creating a queue table to write the
emails to, then using a .net console app running via sql agent scheduled
job
to periodically send the emails in batch mode. However, I worry that this
may also be slow?
Does anyone have a better architecture for this solution? If so give me
some ideas. Thanks!