TextBodyPartCollectionRemove Method |
Removes the text part of the specified content type from the message.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public bool Remove(
string contentType
)
Public Function Remove (
contentType As String
) As Boolean
Parameters
- contentType
- Type: SystemString
A string specifying the content type of text part to be removed.
Return Value
Type:
Booleantrue if the
TextBodyPart object having the specified content type was found in the collection;
otherwise,
false.
Exceptions 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.
using MailBee;
using MailBee.Mime;
MailMessage msg = new MailMessage();
msg.LoadMessage(@"C:\Docs\TestMail.eml");
while (msg.BodyParts.Remove("text/html"));
Imports MailBee
Imports MailBee.Mime
Dim msg As MailMessage = New MailMessage
msg.LoadMessage("C:\Docs\TestMail.eml")
While msg.BodyParts.Remove("text/html")
End While
See Also