Hi all,
I am trying to get email sending in my application to work but keep getting errors
Could someone please have a look at what I’m doing and give me some guidance
A Gmail account is the target email host.
Please note that the message, along with sender & receiver details are loaded in a separate procedure
Using Delphi 12
Uses
IdSMTP1: TIdSMTP;
IdMessage1: TIdMessage;
IdSSLIOHandlerSocketOpenSSL1: TIdSSLIOHandlerSocketOpenSSL;
IdAntiFreeze1: TIdAntiFreeze;
The open SSL library version is openssl-1.0.2u-x64_86-win64
The files ssleay32.dll and libeay32.dll I have copied across to the same folder as the application exe
My code is,
procedure TEmail_Frm.Send_BtnClick(Sender: TObject);
begin
/// //////// Configure the SMTP component
IdSMTP1.Host := 'smtp.gmail.com';
IdSMTP1.Port := 587;
IdSMTP1.Username := Grant_Brown_Txt;
IdSMTP1.Password := Brownes_Block_House_Password;
IdSMTP1.AuthType := satDefault;
/// //////// Configure the SSL component
/// ssleay32.dll and libeay32.dll located in same folder as application exe
IdSSLIOHandlerSocketOpenSSL1.Host := 'smtp.gmail.com';
IdSSLIOHandlerSocketOpenSSL1.Port := 587;
/// //////// Configure the Message component
IdMessage1.From.Name := Current_Sender_User_Name;
IdMessage1.From.Address := Brownes_Block_House_Email_Address;
IdMessage1.Subject := Trim(Subject_EditBx.Text);
IdMessage1.Priority := mpHighest;
IdMessage1.Organization := Brownes_Block_House_Name;
IdMessage1.ContentType := 'text/plain';
/// //////// send the email message
try
IdSMTP1.Connect;
IdSMTP1.Send(IdMessage1);
finally
IdSMTP1.Disconnect();
end;
Enable_Disable_Button(Send_Btn, False);
end;
the latest exception message is,
Project Soluar_Interface_Rev01.exe raised exception
- class EIdOSSLCouldNotLoadSSLLibrary with message ‘Could not load SSL library.’*
Help please as I’m at my wits end with this
Many many thanks in advance
Grant