Sample code for 30+ languages & platforms
Delphi ActiveX Requires Chilkat v11.0.0+

Transition from Imap.ListSubscribed to Imap.MbxList

Provides instructions for replacing deprecated ListSubscribed method calls with MbxList.

Chilkat Delphi ActiveX Downloads

Delphi ActiveX
var
success: Integer;
imap: TChilkatImap;
reference: WideString;
mbxPattern: WideString;
mboxesObj: IMailboxes;
subscribed: Integer;
mboxes: TMailboxes;

begin
success := 0;

imap := TChilkatImap.Create(Self);

//  ...
//  ...

reference := '';
mbxPattern := '*';

//  ------------------------------------------------------------------------
//  The ListSubscribed method is deprecated:

//  Lists only subscribed mailboxes.
mboxesObj := imap.ListSubscribed(reference,mbxPattern);
if (imap.LastMethodSuccess = 0) then
  begin
    Memo1.Lines.Add(imap.LastErrorText);
    Exit;
  end;

//  ...
//  ...

//  ------------------------------------------------------------------------
//  Do the equivalent using MbxList.
//  Your application creates a new, empty Mailboxes object which is passed 
//  in the last argument and filled upon success.

//  Lists only subscribed mailboxes.
subscribed := 1;

mboxes := TMailboxes.Create(Self);
success := imap.MbxList(subscribed,reference,mbxPattern,mboxes.ControlInterface);
if (success = 0) then
  begin
    Memo1.Lines.Add(imap.LastErrorText);
    Exit;
  end;