CPopClient::GetMessageUid Method  
 
INT GetMessageUid(
  UINT nMessageId,  
  LPTSTR lpszMessageUID,  
  INT nMaxLength  
);
INT GetMessageUid(
  UINT nMessageId,  
  CString& strMessageUID  
);

The GetMessageUid method returns the unique identifier (UID) for the specified message in the current mailbox.

Parameters

nMessageId
Number of message to retrieve the unique identifier for. This value must be greater than zero. The first message in the mailbox is message number one.
lpszMessageUID
Address of a string buffer to receive the unique identifier for the specified message. This should be at least 64 bytes in length. This argument may also be a CString object which will contain the UID string when the method returns.
nMaxLength
The maximum length of the string buffer for the message UID.

Return Value

If the method succeeds, it returns a non-zero value. If no unique identifier is assigned to the message, the method will return zero. If an error occurs, the method returns POP_ERROR. To get extended error information, call GetLastError.

Remarks

The GetMessageUid method returns the unique message identifier for the specified message. The returned value is a string which can be used to uniquely identify a specific message in the mailbox across multiple client sessions. This is commonly used by mail clients to determine if they have already retrieved a message from the server in a previous session. The UID can also be used as a key or component of the file name to reference the message after it has been stored on the local system.

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: cspopv10.lib

See Also

GetHeaderValue, GetMessage, GetMessageHeaders, GetMessageId, GetMessageSender