ImapSubscribeMailbox Function  
 
INT WINAPI ImapSubscribeMailbox(
  HCLIENT hClient,  
  LPCTSTR lpszMailbox  
);

The ImapSubscribeMailbox function subscribes the user to the specified mailbox.

Parameters

hClient
Handle to the client session.
lpszMailbox
A null-terminated string which specifies the mailbox to subscribe to.

Return Value

If the function succeeds, it returns zero. If an error occurs, the function returns IMAP_ERROR. To get extended error information, call ImapGetLastError.

Remarks

The ImapSubscribeMailbox function adds the specified mailbox to the current user's list of active or subscribed mailboxes. The user will remain subscribed to the mailbox across multiple sessions, until the ImapUnsubscribeMailbox function is called to remove the mailbox from the subscription list.

To list those mailboxes which the user has subscribed to, use the ImapGetFirstMailbox function and specify the IMAP_LIST_SUBSCRIBED option.

Note that if a user subscribes to a mailbox and that mailbox is later renamed or deleted, the mailbox will not be automatically removed from the user's subscription list. An application must not assume that because a mailbox name is included in the list of subscribed mailboxes, it exists and can be selected. To check if the mailbox exists, use the ImapGetMailboxStatus function.

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