Internet Direct (Indy) Version 9.0.2 Beta
TIdIMAP4.Connect
Opens a connection and attempts to login to the IMAP server.

procedure Connect(const ATimeout: Integer); override;
Parameters
const ATimeout: Integer = IdTimeoutDefault
Number of milliseconds before a connection timeout occurs. Default value is IdTimeoutDefault.

Description
Connect is an overridden procedure in TIdIMAP4 that opens a connection to the IMAP server and attempts to login using the Username and Password for the account.

Connect calls the inherited Connect method, and on successful connection, sets ConnectionState to the value csNonAuthenticated. Connect calls SendCmd using the IMAP LOGIN command and the Username and Password values specified for the account. If the login is accepted by the IMAP server, Connect sets ConnectionState to the value csAuthenticated.

If an exception occurs in Connect, Connect calls Disconnect and re-raises the exception.