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.2.0 build 630 for .NET 4.5
public void RemoveCustomHeaders()
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
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();

// Remove all non-standard headers from the collection.
See Also