HeaderCollectionRemoveCustomHeaders Method
Removes any custom headers from the collection of the message headers.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public void RemoveCustomHeaders()
Remarks
Removes the Header objects with non-standard names from the collection of the message headers. The following headers are standard (and thus will not be removed by this method):
  • BCC
  • CC
  • Content-Type
  • Date
  • From
  • Message-ID
  • MIME-Version
  • Organization
  • Reply-To
  • Return-Path
  • Subject
  • To
  • X-Mailer
  • X-MSMail-Priority
  • X-Priority
Examples
This sample loads the message from .EML file and removes the custom headers 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();
msg.LoadMessage(@"C:\Docs\TestMail.eml");

// Remove all non-standard headers from the collection.
msg.Headers.RemoveCustomHeaders();
See Also