Japanese characters issue and Email headers issue

We recently upgraded from Aspose.Net (version 5.8.0.0 ) to Aspose.Email (version 5.0.0.0). We have 17 offices that use Sharepoint sites and we really appreciate your response as it is affecting our production usage.



So far we have identified 3 issues:

  1. Issue with Domain Account that is passed as an email header: The header strips out "". Example : abc\jsmith becomes abcsmith. This is causing big issue while constructing SPUser object in SharePoint 2007 .
    We are using spwebObject.EnsureUser(emailMessage.Headers[“UserLogin”]. Currently I have placed a workaround by removing this header value for Aspose Email object and setting a new value for this header (from the object for SPEmailMessage. This object has correct value for the username)


  2. For Asian offices, if the body is in Asian language, it comes as “???” (Observed this on a Japanese SharePoint site. Mostly they use English, but some times users send in emails in Japanese language and combination of both).This EML gets saved to SharePoint.We did not have this while using Aspose.Net (version 5.8.0.0). Wondering if there is any property that needs to be set.We did not have to set any properties in the previous version.


  3. We have a client that sends email with a header value for “Content-Type” some thing similar to the following:
    multipart/mixed; boundary=“----=_Part_73094_1480349756.1432545471814”

This EML gets saved to SharePoint (EML format) and when we click on the file we get 404 error.



Code Snippet for issues 2 and 3 …


Stream msMessage = new MemoryStream();

emailMessage.Save(msMessage, Aspose.Email.Mail.SaveOptions.DefaultEml);

msMessage.Position = 0;

SPFile emailFile = web.Files.Add(“emailDestUrl”, msMessage, hashMetaData);




So far , I had to clear out this header for 45 email files so that users could browse the files from SharePoint(these files were already uploaded into SharePoint and I had to manually go to each folder and update the eml source).
I hope someone can help me resolving these 3 issues ASAP.

I’ve just tested with Aspose.Email 5.3.0.0 and

issues 2 & 3 still exist in the latest version 5.3.0.0

Hi Sarath,


Thank you for posting your query.

First of all, its good to know that the latest version of Aspose.Email for .NET 5.3.0 solved your first issue.

For your issue 2 & 3, we need your original sample emails that we can load in MailMessage and then save to the disc or SharePoint library for testing at our end. We shall look into these for assisting you further.

Also, can you please perform the following tests at your end and share your feedback with us for our assistance:

1. Save the MailMessage in EML format to local disc and then open in Outlook to see if the encoding issue still exists?

2. Save the MailMessage in Outlook Unicode MSG format to disc and then open in Outlook to see if the encoding issue still exists? As a result of this test, if you don’t get any issue, you may try saving the EML to MSG Unicode format and then use the following code to convert it back to EML for checking if this helps you in resolving the issue. May be this help you for solving the issue temporary.

Code:

Stream msMessage = new MemoryStream();
emailMessage.Save(msMessage, Aspose.Email.Mail.SaveOptions.DefaultMsgUnicode);//Uncode MSG format
//get this in MapiMessage
MapiMessage mapiMsg = MapiMessage.FromStream(msMessage);

MailMessageInterpretor mi = MailMessageInterpretorFactory

.Instance.GetIntepretor(mapi.MessageClass);

MailMessage mailMsg = mi.Interpret(mapi);

mailMsg.Save(“ReSaved.eml”, SaveOptions.DefaultEml);