I use Delphi XE-1 on Win 7/64, with SSL and Indy, which are installed by default. This week I had to work with SMTP and SSL, and I ran into the same issue you reported. Our application is somewhat complicated and already works and is deployed in several places, and it uses Indy at several points in the code, so installing a new version of Indy and rebuilding, etc. It was not very pleasant.
Since the problem only occurs in the first pass, I followed some of the code and came up with this simple, painless workaround:
smtpClient.connect; smtpClient.disconnect; smtpClient.connect; if not smtpClient.Authenticate then raise ... smtpClient.Send(msg);
As soon as you call connnect and then disconnect , the SSL libraries are loaded, so the second time you call connect you're good to go.
It works great.
source share