We’re very sorry, this is an error in our documentation. Indeed, there is no dispose method in the API right now.
Please use the following code:
from aspose.email.storage.pst import PersonalStorage, FileFormatVersion
from aspose.email.mapi import MapiMessage
with PersonalStorage.create("AddMessagesToPst_out.pst", FileFormatVersion.UNICODE) as pst:
# Add new folder "Inbox"
inboxFolder = pst.root_folder.add_sub_folder("Inbox");
# Add message to Inbox Folder
inboxFolder.add_message(MapiMessage.from_file("MapiMsgWithPoll.msg"))