AttachmentCollectionRemove Method |
Removes the attachment having the specified unique name from the collection.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public bool Remove(
string filename
)
Public Function Remove (
filename As String
) As Boolean
Parameters
- filename
- Type: SystemString
The unique name of the attachment (as returned by Filename property) to be removed.
Return Value
Type:
Booleantrue if the specified attachment was successfully removed; otherwise,
false.
Exceptions Remarks
The developer can also use
RemoveAt(Int32) method to remove the attachment by its integer zero-based index in the collection.
Examples This sample loads the message from .EML file and removes the attachment with
me.jpg filename.
using MailBee;
using MailBee.Mime;
MailMessage msg = new MailMessage();
msg.LoadMessage(@"C:\Docs\TestMail.eml");
msg.Attachments.Remove("me.jpg");
Imports MailBee
Imports MailBee.Mime
Dim msg As New MailMessage
msg.LoadMessage("C:\Docs\TestMail.eml")
msg.Attachments.Remove("me.jpg")
See Also