Tnef Conversion Loss Class
A piece of information that was lost when 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 sealed class TnefConversionLoss- Inheritance
- Object TnefConversionLoss
Remarks
A piece of information that was lost when converting a TnefMessage to MIME.
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
| TnefConversionLoss | Initialize a new instance of the TnefConversionLoss class. |
Properties
| Description | Get a description of the information that was lost. |
| Kind | Get the kind of information that was lost. |
Methods
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
| GetHashCode | Serves as the default hash function. (Inherited from Object) |
| GetType | Gets the Type of the current instance. (Inherited from Object) |
| ToString |
Get a string representation of the loss.
(Overrides ObjectToString) |