Free Support Forum - aspose.com

EML file gets corrupt on loading and saving (C# .NET)

hi, we’ve got a problem when saving an eml file after retriving it from a server with imap client: the resulted file is corrupted.

The issue is reproducible with this file email.eml.zip (2.1 MB)

The steps are:

  1. load message with MailMessage.Load() static method;

  2. save message with save method.

     [TestMethod]
     public void Test()
     {
     	Aspose.Email.License license = new Aspose.Email.License();
     	license.SetLicense("Aspose.Email.lic");
     	
     	string fileName = "email.eml";
     	var message = MailMessage.Load(fileName);
     	message.Save("newMessage.eml");
     }

@biagio_carratu_dedagroup_it,

I have worked with the sample file shared by you and have not been able to observe any issue while using Aspose.Email for .NET 20.2 on my end. Can you please try using specified version on your end.
newMessage.zip (2.1 MB)

I confirm you that we open and save it only and this is the result. newMessage.zip (2.1 MB)
We’re using Aspose.Email 20.2 and dotnet 4.6.1

The file you attached is not readable too, from standard windows mail client and Microsoft Outlook on our end.
Before: Original_Annotazione 2020-03-18 172552.png (51.5 KB)
After: Annotazione 2020-03-18 171301.png (53.8 KB)

@biagio_carratu_dedagroup_it,

I have tried opening the EML file in MS Outlook and have been able to observe the issue. An issue with ID EMAILNET-39761 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.