HeaderCollectionRemoveCustomHeaders Method |
Removes any custom headers from the collection of the message headers.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public void RemoveCustomHeaders()
Public Sub 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.
using MailBee;
using MailBee.Mime;
MailMessage msg = new MailMessage();
msg.LoadMessage(@"C:\Docs\TestMail.eml");
msg.Headers.RemoveCustomHeaders();
Imports MailBee
Imports MailBee.Mime
Dim msg As New MailMessage
msg.LoadMessage("C:\Docs\TestMail.eml")
msg.Headers.RemoveCustomHeaders()
See Also