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

Free Support Forum - aspose.com

PST Performance Question

I have a question about pushing MSG files to a PST. I am try to figure out what the most efficient way of packaging a large number of emails into a PST from disk and wanted to know a few things what the best way to do that is using your API. Some of the emails may have attachments of up to 500Mb so the MSG file itself could be quite large.

If I create a MapiMessage from a FileInputStream, will it read the whole thing into memory before pushing it into the PST using the below code?

FileInputStream fisMapi = new FileInputStream(file);
MapiMessage mMapi = MapiMessage.fromStream(fisMapi);


If it reads the whole email into memory, how can I process a 500Mb file and push it into the PST without reading the whole thing into memory then? Is this the recommended method of loading an email or should I use the MailMessage object instead?


Hi Christopher,

Thank you for writing to Aspose support team.

Adding bulk message with Improved performance can be achieved by IEnumerable Implementation as mentioned in this article. You may please give it a try and let us know the feedback.