CPopClient::GetMessageId Method  
 
INT GetMessageId(
  UINT nMessageId,  
  LPTSTR lpszMessageId,  
  INT nMaxLength  
);
INT GetMessageId(
  UINT nMessageId,  
  CString& strMessageId  
);

The GetMessageId method returns the message identifier for the specified message.

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.
lpszMessageId
Address of a string buffer to receive the message identifier. This should be at least 64 bytes in length. This argument may also be a CString object which will contain the message identifier when the method returns.
nMaxLength
The maximum length of the string buffer.

Return Value

If the method succeeds, the return value is the length of the unique identifier string. If the method fails, the return value is POP_ERROR. To get extended error information, call GetLastError.

Remarks

The GetMessageId method returns the message identifier from the Message-ID header of the specified message. The returned value is a typically a string which specifies the domain, date and timestamp for the message that is created when the message is submitted to the mail server for delivery. To obtain a unique identifier for the message in the mailbox, it is recommended that you use the GetMessageUid method instead.

This method uses the XTND XLST command to obtain the value of the "Message-ID" header field. If this command is not supported by the server, the method will attempt to retrieve the entire message header and return the header value . This enables an application to use this method even if the server does not support command extensions.

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
Unicode: Implemented as Unicode and ANSI versions.

See Also

GetHeaderValue, GetMessage, GetMessageHeaders, GetMessageSender, GetMessageUid