AttachmentIsTnef Property
Indicates if the attachment is MS-TNEF (winmail.dat) container which can have other attachments inside.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public bool IsTnef { get; }

Property Value

Type: Boolean
true if the attachment has MS-TNEF format; otherwise, false.
Remarks

Transport Neutral Encapsulation Format or TNEF is a Microsoft data format used by Microsoft Outlook and Microsoft Exchange Server. TNEF attachments are usually named winmail.dat or win.dat.

TNEF is not a common standard so that most mail clients do not natively support it. However, MailBee allows the developer to extract attachments from TNEF containers into AttachmentCollection using GetAttachmentsFromTnef method and then treat them like any other attachments.

Examples
This sample loads the message from .EML file and saves all TNEF-formatted attachments to disk (if any).
// 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\mstnef.eml");

// For every attachment...
foreach (Attachment attach in msg.Attachments)
{
    // ...when the attachment is TNEF...
    if (attach.IsTnef)
    {
        // ...extract all the files from it and save them to the folder.
        attach.GetAttachmentsFromTnef().SaveAll(@"C:\Temp");
    }
}
See Also