PopGetMessageSender
INT PopGetMessageSender(
HCLIENT hClient,  
UINT nMessageId,  
LPTSTR lpszAddress,  
INT nMaxLength  
);

The PopGetMessageSender function returns the sender's address for the specified message.

Parameters

hClient
Handle to the client session.
nMessageId
Number of message to retrieve header value from. This value must be greater than zero. The first message in the mailbox is message number one.
lpszAddress
Pointer to a string buffer that will contain the address of the message sender.
nMaxLength
The maximum number of characters that may be copied into the buffer, including the terminating null-byte.

Return Value

If the function succeeds, the function returns the length of the address. If the sender cannot be determined, the function will return a value of zero. If the function fails, the return value is POP_ERROR. To get extended error information, call PopGetLastError.

Remarks

The PopGetMessageSender function returns the e-mail address of the user who sent the specified message. This allows an application to be able to easily determine the sender, without downloading the entire header block or contents of the message.

This function uses the XSENDER command, which is an extension to the POP3 protocol, to determine the address of the authenticated sender of the message. If the command is not supported, or the server was unable to authenticate the sender, the function will use the XTND XLST command to obtain the value of the "From" header field. If this command is not supported, the function will return a value of POP_ERROR, indicating that the sender of the message could not be determined.

Requirements

Client: Requires Windows Vista, Windows XP or Windows 2000 Professional.
Server: Requires Windows Server 2008, Windows Server 2003 or Windows 2000 Server.
Header: Include cstools6.h.
Library: Use cspopav6.lib.
Unicode: Implemented as Unicode and ANSI versions.

See Also

PopGetHeaderValue, PopGetMessageHeaders, PopGetMessageId, PopGetMessageUID


Copyright © 2008 Catalyst Development Corporation. All rights reserved.