CImapClient::ExamineMailbox Method  
 
INT ExamineMailbox(
  LPCTSTR lpszMailbox,  
  LPIMAPMAILBOX lpMailboxInfo  
);

The ExamineMailbox method selects the specified mailbox for read-only access.

Parameters

lpszMailbox
A pointer to a string which specifies the new mailbox to be examined.
lpMailboxInfo
A pointer to an IMAPMAILBOX structure which contains information about the mailbox when the method returns. This parameter may be NULL if the caller does not require any information about the mailbox.

Return Value

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

Remarks

The ExamineMailbox method is used to select a mailbox in read-only mode. Messages can be read, but they cannot be modified or deleted from the mailbox and new messages will not lose their status as new messages if they are accessed.

If the client has a different mailbox currently selected, that mailbox will be closed and any messages marked for deletion will be expunged. To prevent deleted messages from being removed from the previous mailbox, use the UnselectMailbox method prior to examining the new mailbox.

If an application wishes to update the information returned in the IMAPMAILBOX structure for the current mailbox, simply call ExamineMailbox again with the same mailbox name.

The special case-insensitive mailbox name INBOX is used for new messages. Other mailbox names may or may not be case-sensitive depending on the IMAP server's operating system and implementation.

To access a mailbox in read-write mode, use the SelectMailbox method.

Requirements

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

See Also

DeleteMailbox, GetFirstMailbox, GetMailboxStatus, GetNextMailbox, RenameMailbox, ReselectMailbox, SelectMailbox, UnselectMailbox