MailMessageHasAttachments Property
Indicates if the message has any attachments.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public bool HasAttachments { get; }

Property Value

Type: Boolean
true if the message has at least one attachment; otherwise, false.
Remarks
If only the headers of the message were received from the mail server, this property may not be 100% accurate. The developer should download the entire message to be sure if it really has any attachments or not.
Examples
This sample downloads the message from the specified POP3 account and displays the number of the message attachments.
using System;
using MailBee;
using MailBee.Pop3Mail;
using MailBee.Mime;

class Sample
{
    static void Main(string[] args)
    {
        // Download the first mail message from the specified POP3 account.
        MailMessage msg = Pop3.QuickDownloadMessage("pop3.mail.com", "kathy1981", "password", 1);

        // Check if the mail message has any attachments and display the corresponding message.
        if (msg.HasAttachments)
        {
            Console.WriteLine("This message has " + msg.Attachments.Count.ToString() + " attachments");
        }
        else
        {
            Console.WriteLine("This message does not have any attachments");
        }
    }
}
See Also