We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Create message file with RTF formatted message body preserving body content

I have a pst file which contains message file with RTF formatted message body with some embedded files(inline attachments)
The pst file will be first processed by XSTReader which just extracts message properties as it could not generate msg file. So, I used Aspose to create msg file using those properties.

I am able to properly create msg files for all cases except message file with RTF body formatted message body. For RTF formatted case also, I am able to create the message file but could not able to preserve the its body format. Actually, it does not render the embedded files correctly.

This is google drive link for sample application -

Above link also contains sample pst file, actual message file saved from pst file using outlook as well as message created from utility.

Hoping the solution from your side.
Thanks in advance

Bal Mukunda Shrestha


You are using old version of Aspose.Email for .NET 22.3. We suggest you please upgrade to the latest version of Aspose.Email for .NET 22.3. Hope this helps you

If you still face problem, please create sample console application that includes Aspose.Email related code and share it here for testing. Please also share the screenshots of problematic sections of output file. We will investigate the issue and provide you more information on it.

Why Aspose.PDF is required for creating message file?
I tried Aspose.Email v22.3 and there were no change in the result. You can use the same above standalone application shared in google drive and try it by replacing latest version of Aspose.Email.

Regarding the problematic sections of the output, you can open the two msg files shared in the google drive. one is directly saved from outlook by opening the pst file and another is created from sample application.


We have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as EMAILNET-40574. You will be notified via this forum thread once this issue is resolved.

We have modified the post. It is Aspose.Email for .NET 22.3. We apologize for your inconvenience.

Any progress on this?


Hopefully, the fix of this issue will be available in the May 2022 release. Please note that this ETA is not final at the moment. We will be sure to inform you via this forum thread once it is resolved.

Hi @tahir.manzoor
When I saw the status as Resolved, I replaced the Aspose.dll with new version v22.5 in the same standalone utility that I provided to you. Unfortunately, still not rendering the email body correctly.
Please see the screenshot.
image.png (7.8 KB)

Is this due to trial version of Aspose.dll? If not, can you please send the modified utility with additional codes changes that need to be applied?


The problem is the message contains OLE attachments that are not saved properly. The XstReader that you use to extract the message properties is a third-party library, so we cannot offer a problem solution for XstReader. Therefore, we recommend applying the latest 22.5 version of Aspose.Email to extract and save messages using following code example.

using var pst = PersonalStorage.FromFile(@"XSTReader_RTF_Format_Inline_Attachment_Test_2.pst");
var folder = pst.RootFolder.GetSubFolder("Drafts");

foreach (var id in folder.EnumerateMessagesEntryId())
    var msg = pst.ExtractMessage(id);