When I set ConnectTimeout at IdSMTP (for example, 30 sec) and the SMTP server is unavailable, it takes off from the SMTP server approximately 105 sec.
This is the Indy component in version 10 - *250.bpl, OpenSSL v1.0.2.
With IdFTP ConnectTimeout work without any problems.
Where may be a bug?
...
IdOpenSSLSetLibPath(FDocumentsPath);
SSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
SMTP:= TIdSMTP.Create(nil);
MSG:= TIdMessage.Create(nil);
try
SSLHandler.SSLOptions.Method:= sslvSSLv23;
SSLHandler.SSLOptions.Mode := sslmClient;
SMTP.IOHandler := SSLHandler;
SMTP.UseTLS:= utUseImplicitTLS;
SMTP.AuthType:= satDefault;
SMTP.Port:= 465;
SMTP.Host:= xxx.xxx.xxx.xxx;
SMTP.Username:= xxxxx;
SMTP.Password:= xxxxx;
SMTP.ConnectTimeout:= 30000;
SMTP.ReadTimeout:= 30000;
try
SMTP.Connect;
except
end;
...
finally
SMTP.Disconnect;
UnLoadOpenSSLLibrary;
FreeAndNil(MSG);
FreeAndNil(SSLHandler);
FreeAndNil(SMTP);
end;