MailBee.NET Objects 7.2

Imap.UnsubscribeFolder Method 

Unsubscribes the previously subscribed folder (mailbox in IMAP4 terms) of the IMAP4 account.

public bool UnsubscribeFolder(
   string folderName
);

Parameters

folderName
The full name of the folder to be unsubscribed.

Return Value

true if the folder was unsubscribed successfully; otherwise, false.

Remarks

This method removes the specified folder from the server's set of "active" or "subscribed" folders as returned by DownloadFolders method when subscribedOnly is set to true.

The developer should specify the full name of the folder (including all parent folders' names if the folder is subfolder of another existing folder). See CreateFolder topic for details regarding folder names.

To unsubscribe a folder asynchronously, see the sample code in BeginExecuteCustomCommand topic.

Exceptions

Exception TypeCondition
MailBeeExceptionAn error occurred and ThrowExceptions is true.

See Also

Imap Class | MailBee.ImapMail Namespace | DownloadFolders