MailBee.NET Objects 7.2

HeaderCollection Class

Represents a collection of all the headers of a mail message or a MIME part.

For a list of all members of this type, see HeaderCollection Members.

System.Object
   System.Collections.CollectionBase
      MailBee.Mime.HeaderCollection

[DefaultMember(MemberName="Item")]
public class HeaderCollection : CollectionBase

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

This collection can be used to examine, modify, add or remove headers to the mail message or its individual parts (such as attachments).

For mail messages, this collection is available through the MailMessage.Headers.

For individual MIME parts, the developer can access headers via MimePart.Headers property.

Attachment and TextBodyPart objects also support MimePart.Headers property.

To get the headers section of the message as string, use MailMessage.RawHeader property. MimePart class also supports such property. Please note that RawHeader properties will return empty string if the source of the message is not available (this is common when you're composing a new message rather than examining an existing one).

Example

The example is available in Header class overview.

Requirements

Namespace: MailBee.Mime

Assembly: MailBee.NET (in MailBee.NET.dll)

See Also

HeaderCollection Members | MailBee.Mime Namespace | MailMessage | Header