I’m trying to optimize a mail backup process of my PST files.
I need to save in msg format only the inbox folder and the sended mail folder.
I can get the root folder using…
PersonalStorage pst = PersonalStorage.FromFile(@pstFilePath);
FolderInfo folderInfo = pst.RootFolder;
But this folder info iterates over Spam folder, Recycle Bin and outbox f.e.
I only need the inbox and sended and I used the methods…
FolderInfo folderRecibido = folderInfo.GetSubFolder(“Bandeja de entrada”);
FolderInfo folderEnviado = folderInfo.GetSubFolder(“Elementos enviados”);
But it only works if the PST file is generated by a Spanish exchange server.
I would like to wonder if anybody can help me with a little snippet to gente the folderInfo of Inbox programatically independent of the folder and pst language.
Thanks in advance.
FolderInfo folderInfoInbox = pst.GetPredefinedFolder(StandardIpmFolder.Inbox);
FolderInfo folderInfoSentItems = pst.GetPredefinedFolder(StandardIpmFolder.SentItems);