AttachmentIsFile Property |
Indicates if the attachment is a file.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public bool IsFile { get; }
Public ReadOnly Property IsFile As Boolean
Get
Property Value
Type:
Booleantrue if the attachment is a file; otherwise,
false.
Remarks
If the filename parameter of Content-Disposition header is not empty,
attachment is considered to be a file. Some attachments, however, are not files:
for instance, antivirus program may add some textual information as an attachment to the message,
but this attachment has no filename and is not intended for saving to disk.
Examples This sample loads the message from .EML file and displays filenames of all files attached to this message.
using MailBee;
using MailBee.Mime;
MailMessage msg = new MailMessage();
msg.LoadMessage(@"C:\Docs\TestMail.eml");
foreach (Attachment attach in msg.Attachments)
{
if (attach.IsFile)
{
Console.WriteLine("Attachment " + attach.Filename + " is a file.");
}
}
Imports MailBee
Imports MailBee.Mime
Dim msg As New MailMessage
msg.LoadMessage("C:\Docs\TestMail.eml")
For Each attach As Attachment In msg.Attachments
If attach.IsFile Then
Console.WriteLine("Attachment " & attach.Filename & " is a file.")
End If
Next
See Also