Internet Direct (Indy) Version 9.0.1 Beta
TIdIMAP4.CreateMailBox
Creates a new mailbox on the IMAP4 server.

function CreateMailBox(const AMBName: String): Boolean;
Parameters
const AMBName: String
Mailbox name to be created on the server.

Returns
Boolean - True on success.

Description
CreateMailBox is a Boolean function that creates the new mailbox specified in AMBName on the IMAP4 server. When AMBName ends with the hierarchy seperator character (returned by ListMailBoxes), additional mailboxes may be created under the current mailbox in the hierarchy. When AMBName contains the hierarchy seperator character anywhere else in the mailbox name, additional mailbox folders should be created prior to the final mailbox name in the specification.

CreateMailBox requires that the value of ConnectionState contain either csAuthenticated or csSelected, or an EIdConnectionStateError exception will be raised.

CreateMailBox calls the SendCmd method using the IMAP CREATE command and the attributes specified in AMBName. CreateMsg sets the return value to True when ResultNo contains wsOk.