MailPutFolder

The MailPutFolder function is used to add, delete, or rename mail folders.

Syntax

BOOL MailPutFolder (HANDLE hMail, BYTE bId, LPWSTR szName);

At a Glance

Header file: Msgstore.h
Platforms: H/PC
Versions: 1.0 and later

Parameters

hMail
Handle to the mail context. This handle is created by the MailOpen function.
bId
A unique integer from zero to 255 that identifies the mail folder. Since a system folder cannot be modified or deleted, this cannot be one of the following identifiers: MAIL_FOLDER_INBOX; MAIL_FOLDER_OUTBOX; MAIL_FOLDER_SENT.
szName
Pointer to a buffer containing a NULL-terminated string that identifies the name of the mail folder. If this parameter is NULL, then the folder identified by bId is deleted.

Return Values

This function returns TRUE if successful; FALSE if it fails. To get extended error information, use MailError or MailErrorMsg.

Remarks

If the bId parameter identifies a folder that already exists in the message store the MailPutFolder function renames the folder to the szName string. If the folder exists and szName is NULL the folder is deleted. If the bId identifier is not found in the database, a folder is created with the name pointed to by the szName parameter.

For more information, see Inbox.

See Also

MailGetFolderName, MailGetFolderId