AttachmentGetAttachmentsFromTnef Method
Extracts all the files from TNEF container and returns them as AttachmentCollection.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public AttachmentCollection GetAttachmentsFromTnef()

Return Value

Type: AttachmentCollection
An AttachmentCollection object representing the collection of attachments extracted from TNEF, or a null reference (Nothing in Visual Basic) if the attachment is not a valid TNEF container.
MailBeeExceptionAn error occurred and ThrowExceptions is true.

Prior to calling this method, check IsTnef property value to determine whether the attachment is TNEF or not.

This overload does not extract RFT message body from TNEF. Use GetAttachmentsFromTnef(TnefExtractionOptions) overload for that.

If winmail.dat contains nested winmail.dat files, they will be decoded as well as "message/rfc822" attachments. To process them, check IsMessageInside property and GetEncapsulatedMessage method to get internal MailMessage object. For that object, you can then iterate through Attachments collection to get its contents. You no longer need to call GetAttachmentsFromTnef for nested objects. Single GetAttachmentsFromTnef call extracts contents from all winmail.dat files on all levels.

The example is available in IsTnef topic. Advanced examples are available in GetAttachmentsFromTnef(TnefExtractionOptions) and TnefParser topics.
See Also