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.5.0 build 687 for .NET 4.5
Syntax
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.
Exceptions
ExceptionCondition
MailBeeExceptionAn error occurred and ThrowExceptions is true.
Remarks

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.

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