HeaderCollectionRemove Method
Removes the header from the collection by the given name.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public bool Remove(
	string name


Type: SystemString
The name of the header.

Return Value

Type: Boolean
true if the header with the specified name was found and removed; otherwise, false.

All headers having the specified name will be removed from the collection. To remove only one header having the specified name the developer should use the RemoveAt(Int32) method.

This sample loads the message from .EML file and removes Subject header from 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();

// When specified header exists...
if (msg.Headers["Subject"] != null)
    // Remove the specified header.
See Also