GetHeader Method  
 

Returns the value of a header field from the specified message.

Syntax

object.GetHeader( MessageNumber, HeaderField, HeaderValue )

Parameters

MessageNumber
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.
HeaderField
A string which specifies the message header to retrieve. The colon should not be included in this string.
HeaderValue
A string variable which will contain the value of the specified message header if the method is successful.

Return Value

A value of true is returned if the header was present and could be retrieved, otherwise a value of false is returned.

Remarks

The GetHeader method returns the value of a header field from the specified message. This allows an application to be able to easily determine the value of a header such as the sender, or the subject of the message. Any header field, including non-standard extensions, may be returned by this method.

This method uses the XTND XLST command, which is an extension to the POP3 protocol. If this command is not supported by the server, the method will attempt to retrieve the entire message header and return the value for the specified header field. This enables an application to use this method even if the server does not support command extensions.

See Also

HeaderField Property, HeaderValue Property, GetMessage Method