Reading OST files

PersonalStorage sourcePST=null;
try{
sourcePST=PersonalStorage.fromFile(destinationPSTPath);
} catch (FormatNotSupportedException e){
throw e;
} catch (IllegalStateException e) {
throw new IllegalStateException("destination file is broken");
}

while opening ost file from MS Outlook 2013 this code throw:

com.aspose.email.FormatNotSupportedException: The file is not in PST format
Did aspose suport this format of files?

Hi Evizone Polska,


Thank you for sharing your concerns with us.

I was able to observe this issue using the latest version of Aspose.Email for .NET 3.3.0 and have logged it for further investigation under issue id: NETWORKNET-34087. I have also linked this thread with the logged thread so as once the issue is fixed, you’ll be notified automatically.

I also notice that if i add messages to OST file outlook (2010) didnt see them. Is there any solutions for that?

Hi Evizone Polska,


I used one of the sample OST from Outlook 2010 and performed the writing and reading operation. I am afraid to inform that I could not reproduce the issue here as all the written messages are properly read from the OST. I also opened this resultant OST in an OST viewer and found all the messages there.

Could you please give a try to the following code which writes and reads message to PST and provide us your feedback?


static void Main(string[] args)
{
Aspose.Email.License license = new Aspose.Email.License();
license.SetLicense(“Aspose.Email.lic”);
WriteMessageToOst();
ReadMessageFromOst();
Console.WriteLine(“Press any key to continue…”);
Console.ReadKey();
}

static public void WriteMessageToOst()
{
PersonalStorage pst = PersonalStorage.FromFile(@“D:\Aspose\ost to pst\outlook.ost”);
FolderInfo rootFolderInfo = pst.RootFolder;
FolderInfo info1 = rootFolderInfo.GetSubFolder(“Root - Mailbox”);
MapiMessage msg = new MapiMessage("newcustomeronnet@gmail.com", "newcustomeronnet1@gmail.com", “Subject32450”, “body32450”);
info1.AddMessage(msg);
}
static void ReadMessageFromOst()
{
try
{
PersonalStorage pst = PersonalStorage.FromFile(@“D:\Aspose\ost to pst\outlook.ost”);
FolderInfo folderInfo = pst.RootFolder.GetSubFolder(“Root - Mailbox”);
DisplayFolderContents(folderInfo, pst);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
private static void DisplayFolderContents(FolderInfo folderInfo, PersonalStorage pst)
{
// display the folder name
Console.WriteLine(“Folder: " + folderInfo.DisplayName);
Console.WriteLine(”==================================");
// display information about messages inside this folder
MessageInfoCollection messageInfoCollection = folderInfo.GetContents();
foreach (MessageInfo messageInfo in messageInfoCollection)
{
MapiMessage mapi = pst.ExtractMessage(messageInfo);
Console.WriteLine("Subject: " + messageInfo.Subject);
Console.WriteLine(“Sender: " + messageInfo.SenderRepresentativeName);
Console.WriteLine(“Recipients: " + messageInfo.DisplayTo);
Console.WriteLine(”------------------------------”);
}
}





Thx for feedback. The reason outlook did not saw messages was that I added messages to folder in root (/archive), and outlook show root folder in message view as /root - Mailbox/IPM_SUBTREE/

Hi Evizone Polska,


Thank you for sharing the feedback and please feel free to contact us in case you have any other query/inquiry regarding Aspose.Email.

[quote user=“Evizone”]

PersonalStorage sourcePST=null;
try{
sourcePST=PersonalStorage.fromFile(destinationPSTPath);
} catch (FormatNotSupportedException e){
throw e;
} catch (IllegalStateException e) {
throw new IllegalStateException(“destination file is broken”);
}

while opening ost file from MS Outlook 2013 this code throw:

com.aspose.email.FormatNotSupportedException: The file is not in PST format
[/quote]
Is there any solution for this issue?

with kind regards

Hi Evizone,


The OST format in Outlook 2013 has been significantly changed and till yet, there are no specifications available for this format. Due to this reason, we are currently unable to provide support for Outlook 2013 OST. Once any such specifications are available, we’ll consider implementation support for this new format. Since this thread is already linked with the logged ticket, you’ll be notified here automatically.

Hi,
Do you have any new information about support of Outlook 2013 OST file format? Are there any estimates on when the solution for this issue will be available?

Evizone,


The issue is still not under consideration to be fixed in an upcoming version of Aspose.Email for .NET. I have requested development team’s feedback about the status of this issue and will update you here once there is some information available in this regard.

We appreciate your patience until then.