Storing to PST kills HTML format for message

The following code adds a message to the pst file but without HTML format. We need the data to be stored in PST in HTML format.


public static void Main(string[] args)
{
string DestinationPstFile = @“D:\temp\testFile.pst”;
if (File.Exists(DestinationPstFile))
File.Delete(DestinationPstFile);

using (var storage = PersonalStorage.Create(DestinationPstFile, FileFormatVersion.Unicode))
{
var pstName = Path.GetFileNameWithoutExtension(DestinationPstFile);

var folder = storage.RootFolder.AddSubFolder(pstName);
var mailMessage = new MailMessage();
mailMessage.To.Add("recipient@test.com");
mailMessage.From = "sender@test.com";
mailMessage.HtmlBody = “\r\n \r\n Text \r\n”;
mailMessage.Date = DateTime.UtcNow;
mailMessage.MessageId = “test”;
var mapiMessage = MapiMessage.FromMailMessage(mailMessage);
folder.AddMessage(mapiMessage);
}
}

Hi Babu,


Thank you for using Aspose.Email.

I have tested your sample code using the latest version of Apsose.Email for .NET 4.1.0 and the output looks fine in the PST. Could you please try this latest version and share your feedback with us? I have attached the output PST here for your reference.