TextBodyPartCollectionRemove Method
Removes the text part of the specified content type from the message.

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


Type: SystemString
A string specifying the content type of text part to be removed.

Return Value

Type: Boolean
true if the TextBodyPart object having the specified content type was found in the collection; otherwise, false.
MailBeeInvalidArgumentExceptioncontentType is a null reference (Nothing in Visual Basic).
If more than one text part of the specified content type exist in the collection, only the first found text part will be deleted. To delete other text body parts of the specified content type, call this method until it starts returning false.
This sample loads the message from .EML file and removes all HTML text parts from the 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 HTML parts from the message.
while (msg.BodyParts.Remove("text/html"));
See Also