Tnef Conversion Options Class
Options for converting a TNEF message to MIME.
Definition
Namespace: MimeKit.Tnef
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public class TnefConversionOptions- Inheritance
- Object TnefConversionOptions
Remarks
Options for converting a TnefMessage to MIME using ConvertToMime(TnefConversionOptions, CancellationToken).
Example
C#
public static MimeMessage ConvertToMime (TnefPart part)
{
// Load the content of the application/ms-tnef (winmail.dat) part.
using (var tnef = part.LoadTnefMessage ()) {
// By default, embedded messages are converted into nested TnefParts. Set ConvertEmbeddedMessages
// to convert them into message/rfc822 MessageParts instead.
var options = new TnefConversionOptions { ConvertEmbeddedMessages = true };
// Convert the TNEF message into a MimeMessage. The converted message does not depend on the
// TnefMessage, so it may still be used after the TnefMessage has been disposed.
var result = tnef.ConvertToMime (options);
// Anything that could not be represented in MIME is reported as a conversion loss.
foreach (var loss in result.Losses)
Console.WriteLine ("TNEF conversion loss: {0}: {1}", loss.Kind, loss.Description);
// Note: Disposing the result would also dispose result.Message, so don't dispose it
// if you want to keep using the message.
return result.Message;
}
}
Constructors
| TnefConversionOptions | Initialize a new instance of the TnefConversionOptions class. |
Properties
| AttachmentPlaceholderCallback | Get or set the method used to generate the text for attachment placeholders in an RTF message body. |
| ConvertEmbeddedMessages | Get or set whether embedded messages should be converted to MIME. |
| GenerateCalendar | Get or set whether a text/calendar part should be generated for calendar items and meeting messages. |
| MaxCalendarExceptions | Get or set the maximum number of modified occurrences of a recurring appointment to write to the calendar. |
| MaxCalendarExceptionsSize | Get or set the maximum total size, in bytes, of the modified occurrences of a recurring appointment that are written to the calendar. |
| OleObjectConverter | Get or set the method used to render OLE object attachments as images. |
Methods
| Clone | Clone the options. |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
| GetHashCode | Serves as the default hash function. (Inherited from Object) |
| GetType | Gets the Type of the current instance. (Inherited from Object) |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
Fields
| Default | The default conversion options. |
| DefaultMaxCalendarExceptions | The default maximum number of modified occurrences of a recurring appointment to write to the calendar. |
| DefaultMaxCalendarExceptionsSize | The default maximum total size of the modified occurrences of a recurring appointment that are written to the calendar. |