Catalyst Internet Mail .NET

InternetMail.DeleteMailbox Method ()

Deletes the currently selected mailbox from the server.

[Visual Basic]
Overloads Public Function DeleteMailbox() As Boolean
[C#]
public bool DeleteMailbox();

Return Value

This method returns a boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.

Remarks

The DeleteMailbox method deletes the currently selected mailbox from the server. The current mailbox will be automatically unselected and any messages marked for deletion will be expunged before the mailbox is removed. If the delete operation fails, the client will remain in an unselected state until either the ExamineMailbox or SelectMailbox method is called

A mailbox cannot be deleted if it contains inferior hierarchical names and has the imapFlagNoSelect attribute. On most systems this is the case when the mailbox name references a directory on the server, and that directory contains other subdirectories or mailboxes. To remove the current mailbox, you must first delete any child mailboxes that exist.

The special mailbox named INBOX cannot be deleted.

See Also

InternetMail Class | SocketTools Namespace | InternetMail.DeleteMailbox Overload List