HeaderCollectionRemove Method |
Namespace: MailBee.Mime
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.
// 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"); // When specified header exists... if (msg.Headers["Subject"] != null) { // Remove the specified header. msg.Headers.Remove("Subject"); }