Hello, I have a problem with some emojis not being displayed correctly.
Please load the file: emoji-test-plainOrig.msg
The result is in: finalResult.msg
This is the code:
using Aspose.Email;
using System;
namespace AsposeTest
{
class Program
{
static void Main(string[] args)
{
var filePath = “path to emoji-test-plainOrig.msg”;
MailMessage message = MailMessage.Load(filePath);
//When loading the file the emojis are not displayed correctly. Check message.Body
var emlSaveOptions = new MsgSaveOptions(Aspose.Email.MailMessageSaveType.OutlookMessageFormatUnicode);
message.Save("finalResult.msg", emlSaveOptions);
}
}
}
files.zip (16.0 KB)
@arnoldbeilandevozon,
I have reproduced the issue and added the EMAILNET-40449 task. You will be notified when we find a decision.
@arnoldbeilandevozon,
Starting with version 21.10, the properties MsgLoadOptions.PreserveRtfContent
and MailConversionOptions.PreserveRtfContent
will be added to Aspose.Email API. You will be able to resolve this issue as shown below:
var msgLoadOptions = new MsgLoadOptions();
msgLoadOptions.PreserveRtfContent = true;
var mailMessage = MailMessage.Load(fileName, msgLoadOptions);
or
var mapiMessage = MapiMessage.Load(fileName);
var conversionOptions = new MailConversionOptions();
conversionOptions.PreserveRtfContent = true;
var mailMessage = mapiMessage.ToMailMessage(conversionOptions);
The issues you have found earlier (filed as EMAILNET-40449) have been fixed in this update.
@arnoldbeilandevozon,
Our development team investigated the issue. The main problem is that your MSG file has an incorrect Body property. You should use the MapiMessage
class to avoid conversion losses:
MapiMessage message = Mapimessage.Load(filePath);
Documents: Working with MAPI Properties
API Reference: MapiMessage Class
Hello,
Looks like it is working fine if I use Aspose without license. However if I use Aspose with license the issue is still happening.
class Program
{
static void Main(string[] args)
{
//AsposeLicenser.LoadLicense();
var filePath = @"pathToFile";
var msgLoadOptions = new MsgLoadOptions()
{
PreserveRtfContent = true
};
MailMessage message = MailMessage.Load(filePath, msgLoadOptions);
var body = message.Body;
MapiMessage mapiMessage = MapiMessage.Load(filePath);
var mapiBody = mapiMessage.Body;
}
}
NoLicense.png (8.5 KB)
WithLicense.png (5.3 KB)
files.zip (16.0 KB)
@arnoldbeilandevozon,
Thank you for the issue description.
I have reproduced the problem with the MSG body and license and logged the issue with ID EMAILNET-40467 in our tracking system. Our development team will investigate this case. You will be notified when the issue is resolved.
@arnoldbeilandevozon,
Our development team investigated the issue. The text body of the original message is corrupted. We were able to provide a fix for correct rendering in Outlook for the related issue, but we cannot do it for this issue. In the case of the evaluation mode, we can change the message body due to the insertion of the evaluation message. But in the case of the licensed mode, we do not allow our API to change the message body and if it is corrupted. It remains as is.