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

Free Support Forum - aspose.com

Sub folder issue

i am creating mbox from pst file format but all emails are coming in single folder.


how to create same folder name in mbox file format?

Hello,


mbox format doesn’t support the folders storing.
Instead, messages for every folder are stored in a separate mbox file.

Thanks

Hi,

If you have any other query, please feel free to write to us. We shall look into your requirements and assist you further.

all pst emails from inbox and sent mails are coming in single folder, that is not good. i want to create saprate mbox for inbox, sent emails

Hi,

Could you please share your sample files with us along with the code of conversion to mbox? We’ll investigate the issue further for assisting you further.

can you please provide me code for creating mbox for inbox only, i don’t want to include sent items and other folder?

Hi,

Exporting a specific folder to MBox is not available in the API. We have requested our product team to provide feedback if this can be supported or even if it is possible. We’ll write back here once some information is available in this regard.

Hi,

This requirement is logged as enhancement ticket under id: EMAILNET-34962 in our issue tracking system for further investigation by the product team. I shall write here as soon as some feedback is received in this regard. Please feel free to write us if you have any other query in this regard.

Hi,


Following is the sample code which can be used to save individual folders in the MBox file. Could you please give it a try and let us know the feedback.

String path = “;<o:p></o:p>

string fileName = Path.Combine(path, "test.pst");

string outFileName = Path.Combine(path, "Inbox.dat");

using (Stream outStream = new FileStream(outFileName, FileMode.Create))

{

using (MboxStorageWriter mboxStorage = new MboxrdStorageWriter(outStream, true))

{

using (PersonalStorage pst = PersonalStorage.FromFile(fileName))

{

FolderInfo inbox = pst.RootFolder.GetSubFolder("Inbox");

MessageInfoCollection messages = inbox.GetContents();

foreach (MessageInfo info in messages)

{

MapiMessage msg = pst.ExtractMessage(info.EntryId);

MailMessageInterpretor mi = MailMessageInterpretorFactory.Instance.GetIntepretor(msg.MessageClass);

MailMessage mail = mi.Interpret(msg);

mboxStorage.WriteMessage(mail);

}

}

outStream.Flush();

}

}