I'm currently evaluating aspose.network for .net for converting eml to msg.
I have encountered a problem with the subject of the mail, we here in sweden use iso-8859-1 in our subject if we add swedish letters, and in my tests those letters gets converted to ? in the subject. Same letters in the body looks as they should.
Is this related to me using a non licensed version where I get (Aspose.Network Evaluation) added to the subject, or is this a problem that I would get in the licensed version too?
Could you please post a test eml file for our testing, which have iso-8859-1 encoding in the subject. You may zip and send it using the forum “contact” --> “send saqib.razzaq an email”.
and thanks for your quick response! Unfortunatly your solution introduced another problem, attachments in the eml-file isn't accessible in the msg-file after using Unicode.
Can you help me with that too, or do I need to chose wich problem to live with?
I have added a zip-file with a eml-file that have attachments and swedish letters in the subject.
Thank you very much for your quick response. Now it works for Body and Attachments, but not for the Mail-Subject. It seems that, the subject encoding has no effect. There are still question marks in the mail subject which should be replaced by the corresponding Umlaute(char).
We have fixed this issue. The bug is caused by the unicode filename not saved properly.
Please try the hotfix attached.
Hi,
I've just tested your hotfix without changing my existing code at all. The '?'-signs remained in the subject, and my swedish signs in the body where lost, so the problem isn't solved as far as I can see.
Problem is, I have this code in a webservice and I get the infile as a base64-string, hnadles it with a memorystream and returns a base64-string. (My code is attached below) Earlier today I didn't change my code to use OutlookMessageFormat.Unicode, but now with my code below I get a msg-file with correct subject and body, but the attachment is corrupted.
/Regards, Stefan
Private Function ConvertEmlToMsg(ByVal strBase64 As String) As String
Dim bArrIn() As Byte = Convert.FromBase64String(strBase64)
Dim inStream As Stream = New MemoryStream(bArrIn)
Dim license As Aspose.Network.License = New Aspose.Network.License
If I use the format OutlookMessageFormat.Unicode, mail subject seems to be correct encoded. But after I send the mail, the recepient recieves it again in ASCII(not ascii chars as '?'). In Outlook "Sent" folder it is unicode, but in "Inbox" folder it is ASCII.
Second Problem is also very interesting, very similar to the first problem. I use mailMessage.htmlbody for mail body.
mailMessage.IsBodyHtml = true;
In draft mode is mail body encoded correctly(from html body). After I send the mail. Mail body is again mailtextbody and not html body.
Thanks for your support. I need urgent to solve this problems.
Please try the latest version of Aspose.Network from http://www.aspose.com/community/files/51/.net-components/aspose.network-for-.net/default.aspx . It should open the converted msg with correct attachments and send the original characters when you send the email via SmtpClient.