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

Free Support Forum - aspose.com

Reconvert msg to eml


We use Aspose network to convert eml to msg which works fine. Another department of the company now needs to convert the file back again to eml and they receive an exception, below you find the exception message.

What could cause this exception?

Exception.Message: Invalid character at position 3.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Parameter name: name

Exception.Source: Aspose.Network

Exception.StackTrace: at Aspose.Network.Mail.Attachment.xb5ce3a2c081eb53a(String xbcea506a33cf9111, String xae050273e3024171)

at Aspose.Network.Mail.Attachment.x20c291f0c9343969(Stream x337e217cb3ba0627, String xc15bd84e01929885, String x9c1b9627c9a8cad5)

at Aspose.Network.Outlook.MailMessageInterpretor.LoadEachAttachment(MailMessage mailmessage, MapiAttachment attach, Int32 index)

at Aspose.Network.Outlook.MailMessageInterpretor.LoadAttachment(MailMessage mailmessage, MapiMessage mapiMessage)

at Aspose.Network.Outlook.MailMessageInterpretor.Interpret(MapiMessage mapiMessage)

at Aspose.Network.Mail.MailMessage.Load(Stream stream, MessageFormat format)

at PippiIndexer.UserControls.FileViewerEML2.ConvertMsgToEml(Byte[] bArrIn)

at PippiIndexer.UserControls.FileViewerEML2.OnDataRetrieved(DataRetrievedEventArgs e)

at PippiIndexer.UserControls.FileViewerBase.OnDataRetrievedThreadSafe(DataRetrievedEventArgs e)

at PippiIndexer.UserControls.FileViewerBase.ShowData(IHostMenu hostMenu, String filename, Byte[] data, String fileType, String fileId)

at PippiIndexer.FMain.ShowBinaryData(BinaryData data, Activity activity)

at PippiIndexer.FMain.SetNewActivity(Activity activity, BinaryData binaryData, IndexInformation indexInformation)

at PippiIndexer.FMain.GetNextActivity(Boolean showMessageIfAtEnd)

at PippiIndexer.FMain.btnGetNextUnindexed_Click(Object sender, EventArgs e)

Exception.Type: System.ArgumentException

I added a file that we have problem with.

Kind Regards,

Malin Forsberg

Hi Malin,

Thanks for considering Aspose.

Please try the latest version of Aspose.Network. I tested the attached msg file, there was no exception, but still the body of eml was coming blank. The code used was:

MailMessage msg = MailMessage.Load(@"EUROPE_FIF00358_MOTSWE_cb4c8dc5-bc69-447a-921c-9209b7d407a7.msg", MessageFormat.Msg);

msg.Save(@"test.eml", MessageFormat.Eml);

Please let us know your results with the latest dll. We will look into the problem and get back to you soon.


Could you also post the source eml file here, which was converted to the above attached msg? We want to check the conversion process (eml --> msg and msg --> eml) using the original eml file.


We have fixed this issue and released a hotfix. Please download the latest dll here:



Hi again,

The hotfix did work, we got an error message when we try to convert the eml file to msg, the error message is: "An invalid character was found in the mail header." And we found as well another issue regarding the attachment when we convert form msg to eml. The attachment file name has swedish charator maybe this could cause another problem.

Please take a look at that as well.

Kind Regards,

The issues you have found earlier (filed as 16126) have been fixed in [this update](http://www.aspose.com/community/files/51/.net-components/aspose.network-for-.net/entry235287.aspx).

This message was posted using Notification2Forum from Downloads module by aspose.notifier.