TLS but SSL Error

Giganews Newsgroups
Subject: TLS but SSL Error
Posted by:  Eric ten Westenend (e.tenwestene…@screeninfomatch.com)
Date: Thu, 6 Aug 2015

Hi

Trying to send Email on port 587.

Getting Error:

'Error connecting with SSL.'#$D#$A'error:140770FC:SSL
routines:SSL23_GET_SERVER_HELLO:unknown protocol'

code:
      Lport := 587;

      SSLIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(SMTP);
      try
        with SSLIOHandler do
        begin
          Destination := ASMTPHost + ':' + IntToStr(LPort);
          Host := ASMTPHost;
          MaxLineAction := maException;
          Port := LPort;
          SSLOptions.SSLVersions := [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2];
          SSLOptions.Mode := sslmUnassigned;
          SSLOptions.VerifyMode := [];
          SSLOptions.VerifyDepth := 0;
        end;
        with SMTP do
        begin
          IOHandler := SSLIOHandler;
          Host := ASMTPHost;
          Password := ASMTPPassword;
          Port := LPort;
          UseTLS := utUseImplicitTLS;

          Username := ASMTPUserID;
          ReadTimeout := 5000;
          ConnectTimeout := 5000;
        end;
        SMTP.Connect;

Also tried all 3 types of UseTLS property value.

What am i doing wrong?

Eric

Replies