CImapClient::CreateMailbox Method  
 
INT CreateMailbox(
  LPCTSTR lpszMailbox  
);

The CreateMailbox method creates a new mailbox on the server.

Parameters

lpszMailbox
A null-terminated string which specifies the new mailbox to be created.

Return Value

If the method succeeds, it returns a value of zero. If an error occurs, the method returns IMAP_ERROR. To get extended error information, call GetLastError.

Remarks

If the mailbox name is suffixed with the server's hierarchy delimiter, this indicates to the server that the client intends to create mailbox names under the specified name in the hierarchy. If superior hierarchical names are specified in the mailbox name, then the server may automatically create them as needed. For example, if the mailbox name "Mail/Office/Projects" is specified and "Mail/Office" does not exist, it may be automatically created by the server.

The special mailbox name INBOX is reserved, and cannot be created. It is recommended that mailbox names only consist of printable ASCII characters, and the special characters "*" and "%" should be avoided. If you need to create a mailbox which contains Unicode characters or symbols, your application should be compiled to use the Unicode character set to ensure that the mailbox name is encoded correctly. If you do not use Unicode, this method will only accept mailbox names using either modified UTF-7 encoding or UTF-8 encoding.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: csmapv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also