Internet Direct (Indy) Version 9.0.2 Beta
TIdSMTP.Connect
Opens a connection to the SMTP server.

procedure Connect(const ATimeout: Integer); override;
Parameters
const ATimeout: Integer = IdTimeoutDefault
Connection timeout in milliseconds. Default value is IdTimeoutDefault.

Description
Connect is a procedure that opens a connection to the SMTP server using the Host and Port properties. An exception will be raised if the connection fails or returns an invalid SMTP response code.

After establishing the socket connection, Connect will clear AuthSchemesSupported. Connect hails the server using either the HeloName or the LocalName properties using either the SMTP EHLO or HELO commands. When the EHLO command is supported on the SMTP server, AuthSchemesSupported will be loaded.

If an exception is raised in Connect, the SMTP client will call Disconnect and the exception will be re-raised.