Command IMAP_DeleteMB

4D Internet Commands

IMAP_DeleteMB

version 6.8.1


IMAP_DeleteMB (imap_ID; mbName) Integer

ParameterTypeDescription
imap_IDLongintReference to an IMAP login
mbNameTextMailbox name to be deleted

Function result Integer Error code

Description

The IMAP_DeleteMB command permanently removes the mailbox of a given name. Attempting to delete an INBOX or a mailbox that does not exist will generate an error.

The IMAP_DeleteMB command cannot delete a mailbox which has child mailboxes and which also has the \Noselect mailbox attribute.

It is possible to delete a mailbox that has child names and does not have the \Noselect mailbox attribute. In this case, all messages in the mailbox are removed and it acquires the \Noselect mailbox attribute.

Note: The IMAP protocol does not guarantee that you can delete a mailbox which is not empty, though on some servers this is allowed. If you do choose to attempt it, you must be prepared to use another method should the more convenient one fail. Further, you should not try to delete the current working mailbox while it is open, but should first close it; some servers do not permit deletion of the current mailbox.

imap_ID is a long integer reference to an open connection created with IMAP_Login.

mbName is the full name of the mailbox to be deleted.

See Also

IMAP_CloseCurrentMB, IMAP_Delete, IMAP_SetCurrentMB.