ImapClient.GetHeader Method (Int32, Int32, String, String)
Returns the value of a header field from the specified message part.
[Visual Basic]
Overloads Public Function GetHeader( _
ByVal messageId As Integer, _
ByVal messagePart As Integer, _
ByVal headerName As String, _
ByRef headerValue As String _
) As Boolean
[C#]
public bool GetHeader(
int messageId,
int messagePart,
string headerName,
ref string headerValue
);
Parameters
- messageId
- An integer value that specifies the message to retrieve the header value from. This value must be greater than zero.
The first message in the mailbox is message number one.
- messagePart
- An integer value that specifies the message part that the header value is to 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.
- headerName
- A string which specifies the message header to retrieve.
- headerValue
- A string passed by reference which will contain the value of the specified message header if the method is
successful.
Return Value
This method returns a boolean value. If the method succeeds, the return value is true. If the method
fails, the return value is false. To get extended error information, check the value of the
LastError property.
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