|Subject:||Question: Speed of SMTP dispatch (inside thread)|
|Posted by:||Steve Forbes (email@example.com)|
|Date:||Wed, 3 Sep 2003|
I am sending a batch of emails via SMTP in a thread (which has tpNormal
priority), and have a question about the speed at which the emails are being
My first cut of the code had the IdSMTP control connecting, sending the
email then disconnecting for each email item, .. this seemed slow, and I
guessed (incorrectly) that the connect/disconnect was causing the delay. I
refactored the code and made the connect happen outside the send loop with a
final disconnect, however, this did not result in any huge speed
improvement. Each email takes between 2 to 5 seconds to send, and as I
potentially have hundreds to process in the batch, the whole process will be
quite lengthy (although not a major issue as it is happening in a thread).
BTW, the thread does not seem to be the issue here as sending the batch
inside the application context is also slow.
I am wondering whether anyone has any suggestions, tips, or tricks on how to
speed up sending SMTP emails, or is this common behaviour?