CImapClient::GetMailboxStatus Method  
 
INT GetMailboxStatus(
  LPCTSTR lpszMailbox,  
  LPIMAPMAILBOXSTATUS lpMailboxStatus  
);

The GetMailboxStatus method returns status information about the specified mailbox.

Parameters

lpszMailbox
A pointer to a null terminated string that specifies the mailbox to return information about.
lpMailboxStatus
A pointer to an IMAPMAILBOXSTATUS structure which contains status information about the specified mailbox.

Return Value

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

Remarks

The GetMailboxStatus method enables an application to obtain status information about a mailbox without having to select another mailbox or open a second connection to the IMAP server to examine the mailbox. The information returned is a subset of the information returned when a mailbox is selected.

Note that obtaining status information for a mailbox may be a slow operation. It may require that server open the mailbox in read-only mode internally in order to obtain some of the status information. For this reason, this method should not be used to check for new messages; use the CheckMailbox method instead.

Some IMAP servers may return an error if you attempt to obtain status information about the currently selected mailbox. The protocol standard states that clients should not use this method on the currently selected mailbox, and should instead use the information returned by the SelectMailbox or ExamineMailbox methods.

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

CheckMailbox, ExamineMailbox, SelectMailbox