HeaderCollectionItem Property (Int32)
Gets or sets the Header object in the collection at the specified zero-based index.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public Header this[
	int index
] { get; set; }

Parameters

index
Type: SystemInt32
The zero-based index of the header in the headers collection.

Property Value

Type: Header
A Header object having the specified zero-based index in the collection.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionIf the specified index doesn't exist.
Examples
This sample loads the message from .EML file and displays all headers of this 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");

for (int i = 0; i < msg.Headers.Count; i++)
{
    Console.WriteLine(string.Format("{0}: {1}", msg.Headers[i].Name, msg.Headers[i].Value));
}
See Also