Internet Direct (Indy) Version 9.0.2 Beta
TIdIMAP4.ListMailBoxes
Retrieves a list of mailboxes for the IMAP4 account.

function ListMailBoxes(AMailBoxList: TStringList): Boolean;
Parameters
AMailBoxList: TStringList
Receives the list of mailboxes for the account.

Returns
Boolean - True on success.

Description
ListMailBoxes is a Boolean function that retrieves a list of mailboxes for the IMAP4 account. ListMailBoxes requires that the value of ConnectionState be csAuthenticated or csSelected, or an EIdConnectionStateError exception will be raised.

ListMailBoxes calls SendCmd using the IMAP LIST command for all mailboxes in the currently selected folder. ListMailBoxes calls ParseListResultDetails to store the mailboxes in CmdResultDetails in the AMailBoxList variable.

ListMailBoxes sets the return value to True when ResultNo contains the value wsOk.