DeleteMailbox Method

Deletes a mailbox from the server.

Syntax

object.DeleteMailbox( MailboxName )

Remarks

The DeleteMailbox method deletes a mailbox from the server. The following is a description of the arguments that may be passed to the method:

MailboxName
A string which specifies the name of the mailbox to be deleted.

A mailbox cannot be deleted if it contains inferior hierarchical names and has the mailFlagNoSelect 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 mailbox, you must first delete any child mailboxes that exist.

If the mailbox that is deleted is the currently selected mailbox, it 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 SelectMailbox method is called.

The special mailbox name INBOX is reserved, and cannot be deleted.

Return Value

A value of zero is returned if the method was successful. Otherwise, a non-zero error code is returned which indicates the cause of the failure.

See Also

MailboxName Property, CheckMailbox Method, CreateMailbox Method, SelectMailbox Method


Copyright © 2008 Catalyst Development Corporation. All rights reserved.