This example is from a production system that handles hundreds of email every day - normally the code below works just fine. But not for the attached email, instead raising: "The header name has an unexpected characters"
System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(aRawDataEML);
//Aspose.Email.Mail.MailMessage message = Aspose.Email.Mail.MailMessage.Load(memoryStream, Aspose.Email.Mail.FileCompatibilityMode.PreserveTnefAttachments);
Aspose.Email.Mail.MailMessage message = Aspose.Email.Mail.MailMessage.Load(memoryStream, Aspose.Email.Mail.MailMessageLoadOptions.DefaultEml);
System.IO.MemoryStream msgMemoryStream = new System.IO.MemoryStream();
try
{
//message.PreferredTextEncoding = System.Text.Encoding.GetEncoding(28591);
//message.BodyEncoding = System.Text.Encoding.GetEncoding(28591);
message.Save(msgMemoryStream, Aspose.Email.Mail.MailMessageSaveType.OutlookMessageFormat);
}
finally
{
msgMemoryStream.Close();
}