Sending emails from a thread

Giganews Newsgroups
Subject: Sending emails from a thread
Posted by:  Ross McMillan (rossm…@gmail.com)
Date: Fri, 30 Sep 2005

I need to send (possibly large) emails from my application but don't want
the main loop to become unresponsive.  I'm proposing to implement a TThread
descendant that will create a TidSMTP and TidMessage and fire off the email
from within the thread.  I figure this will also allow me to send more than
one concurrently, as each email will have it's own TidSMTP.

My question is to do with aborting the email if it should look like it is
going to take a while.  My reading of the TidSMTP component is that once I
call Send the thread will disappear into the bowels of Indy for a long time.
How can I monitor progress of the Send, and possibly abort it early?

Replies