Aspose multi lingual scenario

Hi,

I created an Aspose email message in chinese language. The "From Name", "To Name", "Subject" and Body are in chinese language.

I save the message using Attachment.Save() and give the format of .MSG. After I saved the "From Name", "To Name" and "Subject" becomes question marks (???). Body is OK and comes in chinese properly.

Is there any way we can solve this issue and get "From Name", "To Name" and "Subject" fields in Chinese when I save using Attachment.Save() method?

I tried formatting "From Name", "To Name" and "Subject" in Encoding.UTF8, UTF32 and Unicode. But did not solve the issue.

Just FYI: When I send the email using Aspose SMTPClient class the "From Name", "To Name" and "Subject" fields come in chinese and works correctly. It is the issue when I am saving it to .MSG format

Your help is appreciated.

Thanks,

Venu

Hi Venu,

Thanks for considering Aspose.

If you save a message file using Save() method after setting the encodings and open it in outlook, it will only show body in the UTF-8 encoding. I tried to copy 你好世界 in subject, to, from and body in outlook, but it showed ???. Chineses characters were correctly copied in body only.

However, if you create the message and send it using Aspose. Chinese characters display correctly in subject, from, to and body in web based email clients like gmail or hotmail.

But during tests, I noted that if you create message, save it to disk, load it in MailMessage and then send it using SmtpClient, it shows ??? in subject, from, to and body. We will look into this issue and get back to you soon.

Thanks Saqib. Awaiting for your update.

Regards,

Venu

Could you please let me know if there is(or will be) a version with the above issue fixed?

Thanks,

Venu

Hi,

I am waiting for this issue to get resolved.

Could you please let me know if there is(or will be) a version with the above issue fixed?

Thanks,

Venu

One of your release link says that this issue is fixed. I got the latest version (4.7.0.0) and it is still the same.

<A href="https://forum.aspose.com/t/45612</A></P> <P>3751 - Multi-Language bug in reading the subject of Outlook Message files</P> <P>Could you please confirm whether this issue had been fixed?</P> <P>Thanks,</P> <P>Venu</P>

Hello, Venu,

If you call the MailMessage.Save(string filename, MessageFormat.Msg), the lib will save the data to an ASCII outlook message format file. This is the default behavior.

In the attached dll, we provided a new interface to make it more easy to save an Unicode outlook message format file.

MailMessage.Save(string filename, MailMessageSaveType.OutlookMessageFormatUnicode);

Samples:

[Test]
public void Chinese_Subject2_Test()
{
MailMessage _mailMessage = new MailMessage(test@aspose.com, test@aspose.com);
_mailMessage.Subject = "你好,世界";
_mailMessage.HtmlBody = "你好,世界";

_mailMessage.Save(@"Chinese_Subject2_Test.unicode.msg", MailMessageSaveType.OutlookMessageFormatUnicode);
}

Hi again

It seems, that you have implemented a new bug in the Mime2Outlook Mail conversion.

Given the following Scenarion:

MailMessage _mailMessage = new MailMessage();

_mailMessage.SubjectEncoding = System.Text.Encoding.Unicode;

_mailMessage.Subject = "你好,世界 ”„";

_mailMessage.BodyEncoding = System.Text.Encoding.Unicode;

_mailMessage.HtmlBody = "你好,世界 ”„";

_mailMessage.Save(@"c:\temp\Chinese_Subject2_Test.unicode.msg", MailMessageSaveType.OutlookMessageFormatUnicode);

Aspose.Network.Outlook.MapiMessage mapiMessagePrepared = Aspose.Network.Outlook.MapiMessage.FromMailMessage(_mailMessage, Aspose.Network.Outlook.OutlookMessageFormat.Unicode);

mapiMessagePrepared.SetMessageFlags(Aspose.Network.Outlook.MapiMessageFlags.MSGFLAG_UNSENT | Aspose.Network.Outlook.MapiMessageFlags.MSGFLAG_FROMME);

mapiMessagePrepared.Save(@"c:\temp\Chinese_Subject2_Test1.unicode.msg");

After sending the Mail via Outlook 2003 SP3, the received Mail does not have a mail body anymore. And the Special Chars in the Subject are again replaced by Question Marks. --> See Attachment!

Please fix this strange bug as soon as possible.

Thank you very much!

Christian Broennimann

Thank you. This solved my issue.

Regards,

Venu