MailBee.NET Objects 4.0

HeaderCollection.Clear Method 

Clears the collection of the headers.

new public void Clear();

Implements

IList.Clear

Example

This sample loads the message from .EML file and removes all headers from this message.

[C#]
// 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");

// Remove all headers.
msg.Headers.Clear();
[Visual Basic]
' To use the code below, import MailBee namespaces at the top of your code.
Imports MailBee
Imports MailBee.Mime

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

' Load the message from file.
Dim msg As New MailMessage
msg.LoadMessage("C:\Docs\TestMail.eml")

' Remove all headers.
msg.Headers.Clear()

See Also

HeaderCollection Class | MailBee.Mime Namespace | Header