We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Truncation issue with attachment after upgrade

We recently upgraded Aspose and are now running into an issue with the body of an attached email being truncated. Please see screenshot with before and after code. We had to change it because MailMessageSaveType.OutlookMessageFormat was deprecated. When I use SaveOptions.DefaultMsg the attached email is truncate and when I use SaveOptions.DefaultHtml, i’m unable to open the attachment (see screenshot)

Hi Chad,


We regret the inconvenience you are facing.

Please share your sample EML or MSG file with us that you have observed the issue with. We need it for investigating the issue at our end and assisting you further.

Attached, basically we are attaching a copy of the original email to one that gets overridden. The body is below, but all you see in the attachment is the first piece, then it is truncated.



Dear d b,

This is a test line 1



This is a test line 2



This is a test line 3



This is a test line 4



This is a test line 5



This is a test line 6


This is a test line 7

Hi Chad,

Thank you for sharing sample.

We have investigated the issue at our end. Initial investigation shows that the loading the MSG file (after saving it using SaveOptions.DefaultHtml) issue persists. The issue has been logged into our system with ID EMAILNET-38740. Our product team will look into it and provide feedback. We will update you with the feedback in this thread once available.

Further about truncation issue, we are unable to reproduce this issue at our end. Please try again at your end using latest version of Aspose.Email for .NET. Feel free to contact us in case of any query or comments along with a sample project demonstrating the issue.

Hi Chad,

Our product team has further investigated the issue. Note that, saving the message with the SaveOptions.DefaultHtml option converts it into HTML format. So, you have to save the message with .html extension not with .msg extension. Like below:

CODE:
Aspose.Email.MailMessage mailMsg = Aspose.Email.MailMessage.Load(@"TestEmail.msg");
mailMsg.Save(@"TestEmail_out.html", Aspose.Email.SaveOptions.DefaultHtml);

Screenshot of the output is also attached for your reference. In case you want to keep the attachment (which is a message), you may use the following code snippet:

CODE:
var original = MailMessage.Load("original.msg");
var attachment = original.Attachments[0];
attachment.Save( "attachment.msg");