title: "SSL negotiation failed" in Delphi 11
body: <p>I try to send eMail with the code below (taken from <a href="http://delphiprogrammingdiary.blogspot.com/2014/12/how-to-send-email-in-delphi.html" rel="nofollow noreferrer">http://delphiprogrammingdiary.blogspot.com/2014/12/how-to-send-email-in-delphi.html</a>) without success.
  Constantly I receive the error (&quot;socket error 10054 connection reset by peer&quot; twice and finally &quot;SSL negotiation failed&quot;) at the statement &quot;Send(IdMessage1)&quot; although client is successfully connected with server.</p>
  <pre><code>    procedure SendEmailClick(Sender: TObject);
  var
      IdMessage1: TIdMessage;
      Attachmentfile: TIdAttachmentFile;
  begin
  // IO HANDLER SETTINGS //
  With TIdSSLIOHandlerSocketOpenSSL.Create(nil) do
      begin
          Destination := 'mySrver.com:587';
          Host := 'mySrver.com';
          MaxLineAction := maException;
          Port := 587;
          SSLOptions.SSLVersions := [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2];
          SSLOptions.Mode := sslmUnassigned;
          SSLOptions.VerifyMode := [];
          SSLOptions.VerifyDepth := 0;
      end;
  //SETTING SMTP COMPONENT DATA //
  with TIdSMTP.Create(nil) do begin
      Host := 'mySrver.com';
      Port := 587;
      Username := myMailAddress; // please change to your gmail address //
      Password := myPassword;
      IOHandler := TIdSSLIOHandlerSocketOpenSSL.create;
      AuthType := satDefault;
      UseTLS := utUseExplicitTLS;
  // SETTING email MESSAGE DATA //
      IdMessage1:= TIdMessage.Create(nil);
      IdMessage1.Clear;
  // add recipient list //
      with IdMessage1.Recipients.Add do
          begin
              Name := 'Recipient 1';
              Address := recipient1Address; // please change email address as required //
          end;
  //add Attachment to mail //
      Attachmentfile := TIdAttachmentFile.Create(IdMessage1.MessageParts,'Τιμολόγιο 659.PDF');
      IdMessage1:= TIdMessage.Create(nil);
      IdMessage1.From.Address :=  myMailAddress;  // please change to your gmail address //;
      IdMessage1.Subject := 'Test Email Subject';
      IdMessage1.Body.Add('Test Email Body');
      IdMessage1.Priority := mpHigh;
      TRY
          Connect(); // no problem here. it connects always 
          Send(IdMessage1); // raises the error SSL negotiation failed
          ShowMessage('Email sent');
          Disconnect();
      except on e:Exception do
          begin
              ShowMessage(e.Message);
              Disconnect();
          end;
      END;
      IdMessage1.Free;
      IOHandler.Free;
  end;
  AttachmentFile.Free;
  end;
  </code></pre>
  <p>Can you help me please ?</p>
  <p>PS1. The same problem raises with any MAPI server (myServer, GMail, Yahoo etc)
  PS2. The SSL DLLs are present and they are used by the same application to connect for other purpose without this problem.</p>