HeaderCollectionItems Method
Returns the collection of headers having the given name.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public HeaderCollection Items(
	string name
)

Parameters

name
Type: SystemString
The name of the header.

Return Value

Type: HeaderCollection
A HeaderCollection object containing the headers having the specified name, or a null reference (Nothing in Visual Basic) if such headers do not exist in the collection.
Remarks
This method should be used if the mail message contains several headers with the same name and the developer wants to examine them all. In other cases, it's easier to use ItemString property.
Examples
This sample loads the message from .EML file and displays "Received" headers of the message.
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Mime;

// The actual code (put it into a method of your class)

// Load the message from file.
MailMessage msg = new MailMessage();
msg.LoadMessage(@"C:\Docs\TestMail.eml");

// Access the list of "Received" headers.
HeaderCollection receivedHeaders = msg.Headers.Items("Received");

if (receivedHeaders != null)
{
    // For each header...
    foreach (Header hdr in receivedHeaders)
    {
        // Show the name and the value of the header.
        Console.WriteLine(string.Format("{0}: {1}", hdr.Name, hdr.Value));
    }
}
See Also