Topic Path: Pending > TIdIMAP4.ListSubscribedMailBoxes@TStringList
ContentsIndexHome
PreviousUpNext
TIdIMAP4.ListSubscribedMailBoxes@TStringList

Retrieves the list of subscribed mailboxes on the IMAP4 server.

Parameters 
Description 
AMailBoxList 
Destination for the list of subscribed mailboxes. 

Boolean - True on success, False on protocol error or exception.

ListSubscribedMailBoxes is a Boolean function used to retrieve the list of subscribed mailbox from the IMAP4 server, and store the results in AMailBoxList. ListSubscribedMailBoxes implements the IMAP4 LSUB command using arguments required to retrieve all mailboxes having the appropriate IMAP4 flags. 

ListSubscribedMailBoxes requires that the ConnectionState property for the client contain either the value csAuthenticated or csSelected. When ConnectionState is not valid for the operation, an EIdConnectionStateError exception wil be raised and the return value for the method will be False. The return value will be True when the LSUB command has compeleted with the wsOk protocol response code and the list of mailboxes has been parsed in the AMailBoxList parameter. 

Use SelectMailBox to activate a particular mailbox in the subscribed mailbox list. 

Use UnsubscribeMailBox to remove a mailbox from the subscribed list on the IMAP4 server. 

Please note that IMAP4 servers are required to have an "Inbox" folder to allow them to receive email for a given user. This may or may not be case-sensitive. Your implementation may require you to create an Inbox folder if it does not already exist. 

WARNING: 

Be careful with the characters you use for mailbox names. Different IMAP servers may allow, and interpret differently, various characters, which is allowed within the IMAP specification. Characters such as ~ / and . may have special meaning in the IMAP servers context, and may produce unexpected results. In practice, some IMAP servers may be case-sensitive and others not. It is recommended that you only use the characters A-Z and 0-9 and that you program to allow for case sensitivity or insensitivity, as applicable. Note that, in general, IdIMAP4 adds double-quotes around mailbox names, which allows the use of spaces in mailbox names, but also note that a perticular IMAP server may not allow spaces (this functionality is necessary to allow IdIMAP4 deal with pre-existing mailboxes that include spaces).

SelectMailBox UnsubscribeMailBox

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.