Quantcast
Channel: Aspose.Email Product Family
Viewing all articles
Browse latest Browse all 1367

Email does not convert to MSG format

$
0
0
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();
            }


Viewing all articles
Browse latest Browse all 1367

Trending Articles