These are chat archives for IndySockets/Indy

21st
Nov 2017
Scott Gast
@ScottWGast_twitter
Nov 21 2017 16:20
I'm new to Gitter... TIA for any help you can provide. I have a legacy app written in D5 + Indy 9.0.11 and I need to send email through smtp.office365.com which requires TLS1 and port 587. I believe that I have the indy components set correctly, but I keep getting the error message "EidOSSLConnectError with message 'Error connecting with SSL.'. I have downloaded and tried various versions of Indy Open SSL libeay32.dll and ssleay32.dll.
Scott Gast
@ScottWGast_twitter
Nov 21 2017 17:18
If necessary, I can update to Indy 10 for Delphi 5... if it's available.
Remy Lebeau
@rlebeau
Nov 21 2017 17:28
@ScottWGast_twitter Indy 10 would be best, but it is not easy to install/migrate, especially in such an old Delphi version. What you ask for can be done in Indy 9, too. First, Indy 9 requires special-built OpenSSL DLLs, which you can get from http://indy.fulgan.com/SSL/Archive/ (the indy_openssl096X.zip files). Second, SMTP port 587 requires the client to send a STARTTLS command before activating SSL/TLS. TIdSMTP in Indy 9 does not natively support that command, but you can implement it manually in your own code. Assign a TIdSSLIOHandlerSocket to the TIdSMTP.IOHandler property and configure it for TLS1 as needed, and set TIdSSLIOHandlerSocket.PassThrough=True, then Connect() to port 587, call TIdSMTP.SendCmd('STARTTLS'), and if a 220 reply is returned then set TIdSSLIOHandlerSocket.PassThrough=False. If successful (no exception is raised), use SendCmd() again to send a new SMTP greeting, (HELO or EHLO command). If you send EHLO and it returns 250, call TIdSMTP.GetAuthTypes() (which is protected, so use an accessor class to reach it), otherwise send HELO. After the greeting is successful, you can use TIdSMTPnormally to authenticate and send emails as needed
Scott Gast
@ScottWGast_twitter
Nov 21 2017 17:50
@rlebeau You're a Gentleman and a Scholar! Thank you for the information and pointing me in the right direction :) I'll let you know my results.