AttachmentIsFile Property
Indicates if the attachment is a file.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public bool IsFile { get; }

Property Value

Type: Boolean
true 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.
// 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");

// For every attachment...
foreach (Attachment attach in msg.Attachments)
{
    // ...when it's a file...
    if (attach.IsFile)
    {
        // ...then show its filename.
        Console.WriteLine("Attachment " + attach.Filename + " is a file.");
    }
}
See Also