GetHeader Method  
 

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

Syntax

object.GetHeader( MessageNumber, MessagePart, 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.
MessagePart
The message part that the header value will be be retrieved from. Message parts start with a value of one. A value of zero specifies that the RFC822 header field for the message will be used.
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 part. 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.

See Also

HeaderField Property, HeaderValue Property, GetMessage Method