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

Free Support Forum - aspose.com

Failed to load the eml to MapiMessage

Hi,

I am using Aspose to create the pst file.It works for me for different samples of eml.
But there is one eml file which I unable to add to pst.When I load this eml file to MapiMessage
it gives me the exception as follows
-----------------------------------------------------------
he header name has an unexpected characters
ERROR2014-05-20 11:30:07 - Stack Strace :: at ?.?.?()
at ?.?.?()
at ?.??.??()
at ?.??.?(Byte[] )
at ?.??.??()
at Aspose.Email.Mail.MailMessage.???(Stream , MailMessageLoadOptions )
at Aspose.Email.Mail.MailMessage.Load(Stream stream, MailMessageLoadOptions options)
at Aspose.Email.Mail.MailMessage.Load(String fileName, MessageFormat format)
---------------------------------------------------------------------------------------------
I attached the sample eml file.Please consider this issue on priority basis.
This issue occurs very frequently with so many samples.
Waiting for your reply.

Thanks in advance.


Hi Pooja,


Thank you for sharing your concern with us.

Could you please try using the SkipValidityChecking option in your code and let us know your feedback then? It is working fine while this flag is used.

Sample Code:

string dir = “EMAIL_549155\”;<o:p></o:p>

MailMessageLoadOptions options = MailMessageLoadOptions.DefaultEml;

options.FileCompatibilityMode = FileCompatibilityMode.SkipValidityChecking;

MailMessage eml = MailMessage.Load(dir

  • “13.eml”, options);