Aspose PST to HTML conversion

I’m trying to reproduce the example from the site. But there is no value Html in Aspose.Email.Storage.Pst.FileFormat enum.

Also, the online converter from the page fails with an error “You are trying to upload document(s) of unsupported type:PST”.

Hello @pavel.zaitsau,

Those sample code is a rough oversight. I guess you need to extract messages from a PST and save them in HTML format? Please try the following code example:

// load the PST file
using (PersonalStorage personalStorage = PersonalStorage.FromFile("sourceFile.pst"))
{
    // Get a folder, Inbox for example
    var inboxFolder = pst.RootFolder.GetSubFolder("Inbox");
    // Extract messages from folder
    foreach (var mapiMessage in inboxFolder.EnumerateMapiMessages())
    {
        // Save msg to HTML file
        mapiMessage.Save($"{fileName}.html", SaveOptions.DefaultHtml);
    }
} 

Sorry for the inconvenience and thank you.

How to convert PST to HTML
Open our free PST to HTML converter website.
Click inside the file drop area to upload PST file or drag & drop PST file.
Click on Convert button.
Download link of result files will be available instantly after conversion.
You can also send a link to the HTML file to your email address.

Regards,
Diana

Thank you @DmitryS for your attempt. It doesn’t work too. There is no Save method for a message

image.png (70.7 KB)

Thank you @Dianahemes
It fails with an error “You are trying to upload document(s) of unsupported type:PST”

Hello @pavel.zaitsau,

Thank you @DmitryS for your attempt. It doesn’t work too. There is no Save method for a message

Please be more attentive. MessageInfo does not contain a Save method. The MapiMessage class contains a Save method. You probably used the EnumerateMessages method instead of EnumerateMapiMessages.

Thanks.

Many thanks! You’re right!

@pavel.zaitsau,

Great! Feel free to contact us if you face any issues with Aspose.Email. Thanks.