1
votes

I wrote this code to send email to gmail and another private mail server. here is the code:

IdMessage1.Recipients.EMailAddresses := lblFrom.Text;
IdMessage1.Subject := lblSubject.Text;
IdMessage1.Body.Text := Memo1.Text;

 IdSMTP1.Connect;
 IdSMTP1.Send(IdMessage1);
 IdSMTP1.Disconnect;

but I get error on smtp.connect:

error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number

The component IdSSLIOHandlerSocketOpenSSL1 has the SSLOptions.SSLVersions := [sslvTLSv1]

I tried to change it to SSLOptions.SSLVersions := [sslvTLSv1, sslvSSLv3] but I get error:

error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol.

How to fix these problems ?

I am using Delphi Tokyo and Indy version 10.6.2.5366

1
Have you tried to follow this?Victoria
@Victoria yes I get unknown protocol errorWilliam

1 Answers

4
votes

wow I found it I had to set the IdSMTP1.UseTLS := utUseExplicitTLS