I have an Email file (.eml). I can open that file as a MailMessage object using MailMessage.Load(string filename, FileCompatibilityMode.PreserveTnefAttachmentsFileCompatibilityMode.PreserveTnefAttachments). The MailMessage object has one attachement. The one attachement is a winmail.dat file.
I have tried to open that message using:
MapiMessage orig = MapiMessage.LoadFromTnef(fwMsg.Attachments[0].ContentStream);
However I get an error of:
System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object.
Source=Aspose.Email
StackTrace:
at ..(Stream )
at ..(Byte[] )
at ..()
at Aspose.Email.Mail.MailMessage.Load(Stream stream, MessageFormat format)
at Aspose.Email.Mail.MailMessage.Load(Stream stream)
at Aspose.Email.Outlook.MapiMessage.get_Headers()
at Aspose.Email.Outlook.MapiMessage.Save(Stream stream)
at Aspose.Email.Mail.TnefAttachment.(IEnumerable`1 )
at Aspose.Email.Mail.TnefAttachment.(TnefAttachment , Boolean )
at Aspose.Email.Outlook.MapiMessage.LoadFromTnef(Stream stream)System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object.
Source=Aspose.Email
StackTrace:
at ..(Stream )
at ..(Byte[] )
at ..()
at Aspose.Email.Mail.MailMessage.Load(Stream stream, MessageFormat format)
at Aspose.Email.Mail.MailMessage.Load(Stream stream)
at Aspose.Email.Outlook.MapiMessage.get_Headers()
at Aspose.Email.Outlook.MapiMessage.Save(Stream stream)
at Aspose.Email.Mail.TnefAttachment.(IEnumerable`1 )
at Aspose.Email.Mail.TnefAttachment.(TnefAttachment , Boolean )
at Aspose.Email.Outlook.MapiMessage.LoadFromTnef(Stream stream)
Any thoughts?