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.5.0 build 687 for .NET 4.5
Syntax
public bool Remove(
	string contentType
)

Parameters

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.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptioncontentType is a null reference (Nothing in Visual Basic).
Remarks
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.
Examples
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();
msg.LoadMessage(@"C:\Docs\TestMail.eml");

// Remove all HTML parts from the message.
while (msg.BodyParts.Remove("text/html"));
See Also