Badnaf 0 Posted 14 hours ago (edited) Hey, I am creating a school project where for the registration part, users type in their email and the program sends a generated verification code to their real-life email (Gmail). I'm trying to send a verification code to their email using Gmail's SMTP server through Indy components. Components I’m using: TIdSMTP: to connect to Gmail's SMTP and send the email TIdMessage: to define the email content (from, to, subject, body) TIdSSLIOHandlerSocketOpenSSL: to enable TLS/SSL encryption Delphi is set to build in 32-bit Windows I added libeay32.dll and ssleay32.dll to the folder where the .exe is located All my code compiles and the UI runs fine Email setup appears correctly (SMTP host: smtp.gmail.com, Port: 587, TLS enabled, app password used) The issue: When I click the button to send the email, I get this error: Could not load SSL library I downloaded what I thought was the correct OpenSSL 1.0.2u (32-bit) from GitHub, but the files seem incorrect or too small (e.g., 1.3MB instead of 2.5MB). Also, I couldn’t find any actual releases section on the OpenSSL GitHub page for the Indy-specific binaries. What I need help with: Where can I get the correct OpenSSL 1.0.2u 32-bit (light) DLLs that work with Delphi and Indy? Is there anything else I may be doing wrong with loading the SSL library? Should the SSL DLLs be placed somewhere other than next to the .exe? Any guidance or links to working binaries would be really appreciated! Thank you 🙏 I am not too experienced send emails and handeling communication using the internet through delphi so I am sorry if I did things stupidly, also, I am still busy with my GUI, I just wanted the program to send the email before fixing everything else. Edited 13 hours ago by Badnaf Share this post Link to post
Remy Lebeau 1595 Posted 13 hours ago (edited) First off, you posted a screenshot of code that appears to contain an actual live app password in it. I suggest you delete that screenshot, invalidate that app password, and generate a new one. Don't EVER post live credentials to an online forum! Now then... 44 minutes ago, Badnaf said: When I click the button to send the email, I get this error: Could not load SSL library What does Indy's IdSSLOpenSSLHeaders.WhichFailedToLoad() function report after the error has occurred? 44 minutes ago, Badnaf said: I downloaded what I thought was the correct OpenSSL 1.0.2u (32-bit) from GitHub, but the files seem incorrect or too small (e.g., 1.3MB instead of 2.5MB). All of the DLLs on the GitHub page have been tested with Indy and known to be working. 44 minutes ago, Badnaf said: Also, I couldn’t find any actual releases section on the OpenSSL GitHub page for the Indy-specific binaries. There isn't a releases section. That repo is just a collection of downloadable files. 44 minutes ago, Badnaf said: Where can I get the correct OpenSSL 1.0.2u 32-bit (light) DLLs that work with Delphi and Indy? From https://github.com/IndySockets/OpenSSL-Binaries 44 minutes ago, Badnaf said: Should the SSL DLLs be placed somewhere other than next to the .exe? No, that is the best place. However, if you wanted to put them somewhere else, you can do that, too. You would just have to call Indy's IdSSLOpenSSLHeaders.IdOpenSSLSetLibPath() function at runtime to tell Indy where the DLLs are located. Edited 13 hours ago by Remy Lebeau Share this post Link to post
Badnaf 0 Posted 13 hours ago Quote First off, you posted a screenshot of code that appears to contain an actual live app password in it. I suggest you delete that screenshot, invalidate that app password, and generate a new one. Don't EVER post live credentials to an online forum! Thank you, I did not notice that, sorry. I don't know why but as soon as I used the function and put the 'IdSSLOpenSSLHeaders' in the unit section, everything worked seamlessly, thank you so much for you support, I know you are just as surprised about how quickly this issue was resolved.🙏 Share this post Link to post