If the open method raises an exception like "Connection Lost" the sendEmail call will also raise an exception. The sendEmail method is a basic Indy SMTPClient with an SSL IO Handler defined. The exception raised by the SMPTClient is "Unable to connect to SSL"

Is there something in TElSimpleSFTPClient that is not being cleaned up properly when the open() fails?

Thanks for the quick reply. I moved the sendEMail call outside the exception block as you suggested but the problem is still the same. I also upgraded to the latest version "SecureBlackbox - version 5.2.122 - Released September 25, 2007" just to be on the safe side - still no change.

After some investigation and several emails backwards and forwards it appears that the SMTP server wasn't set up correctly thus causing the failure, so the problem is now sorted and we're working again.