TnefParser.GetAttachments Method (Stream, TnefExtractionOptions)
TnefParserGetAttachments Method (Stream, TnefExtractionOptions)
Extracts attachments and, optionally, rich-text body from a TNEF stream.

Namespace: MailBee.Tnef
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
public static AttachmentCollection GetAttachments(
	Stream data,
	TnefExtractionOptions options


Type: System.IOStream
The stream containing TNEF data.
Type: MailBee.MimeTnefExtractionOptions
Specifies which kinds of items (attachments and/or RTF message body) to extract from TNEF.

Return Value

Type: AttachmentCollection
An AttachmentCollection object representing the collection of the requested items extracted from TNEF.
MailBeeInvalidArgumentExceptiondata is a null reference (Nothing in Visual Basic).
MailBeeExceptionA stream reading or TNEF parsing error occurred.

In case if you got an e-mail with a TNEF attachment, it's easier to use GetAttachmentsFromTnef method to extract data from it.

Note Note
For this overload, it's important to make sure the source stream does not end with CRLF (sometimes, winmail.dat files have this excessive CRLF). For instance, with most stream classes you can use SetLength(Int64) method to decrease the stream length by two in case if it ends with CRLF. Or, simply use GetAttachments(byte[], TnefExtractionOptions) overload which internally does that.
See Also