I try to sent an e-mail using the Indy SMTP component, but I keep getting the error Failed to load libeay32.dll, no matter where I place the DLL's, it will not sent the e-mail.
The website runs as an ISAPI module in IIS, server OS is Windows 2016. DLL's are placed in C:\Windows\System32 and the folder where ISAPI dll is placed.
It works nice on my local machine, but throws error on the server.
We need SSL support as we are sending via office365.
The code:
iSMTP.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(iSMTP);
iSMTP.UseTLS := utUseExplicitTLS;
TIdSSLIOHandlerSocketOpenSSL(iSMTP.IOHandler).SSLOptions.Method := sslvTLSv1_2;
iSMTP.Host := 'fromsettings';
iSMTP.Port := 587;
iSMTP.AuthType := satDefault;
iSMTP.Username := 'fromsettings';
iSMTP.Password := 'fromsettings';
iSMTP.Connect;
iSMTP.Send(iMessage); //<-- This throws error
What am I missing?