PopGetMessageId Function  
 
INT WINAPI PopGetMessageId(
  HCLIENT hClient,  
  UINT nMessageId,  
  LPTSTR lpszMessageId,  
  INT nMaxLength  
);

The PopGetMessageId function returns the message identifier for the specified message.

Parameters

hClient
Handle to the client session.
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.
nMaxLength
The maximum length of the string buffer.

Return Value

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

Remarks

The PopGetMessageId function 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 PopGetMessageUid function instead.

This function 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 function will attempt to retrieve the entire message header and return the value for the specified header field. This enables an application to use this function 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

PopGetHeaderValue, PopGetMessage, PopGetMessageHeaders, PopGetMessageSender, PopGetMessageUid