How to Get Folder inside Inbox for SharedMail Box in Aspose.Email

I have Folder named Test inside Inbox and inside Test i have some Email.How to get that email in Aspose.Currently I am able Fetch mail inside Inbox not inside Test.
Current Code
string[] items = client.ListItems(sharedEmail, “Inbox”);

foreach (string item in items)
MapiMessage msg = client.FetchItem(item);
Console.WriteLine(“Subject:” + msg.Subject);
It is working fine for is not fetching custom folder inside Inbox.How to get that one.If provide some sample code in c# or it will be helpful.



I suggest you to please visit the following thread link for your convenience to access the Shared Mailbox.

image.png (6.5 KB)

how to access SureshFolder.


You may need to add the folder name. In the following image, the example is loading messages from Inbox folder. You may consider setting your own folder name.

Hi ,
i am looking a custom folder outside Inbox.
for ex i have folder inbox,sentitems,drafts,deleteitems and sureshtest.i want to access sureshtest.
my code
Dim messageInfoCol As ExchangeMessageInfoCollection = client.ListMessages(shared.mail, “sureshtest”, false).it is not working.please help.

i am getting error like invalid uri if i am passing the custom folder.


We can check all shared mailbox folders from root:

ExchangeMailboxInfo mi = client.GetMailboxInfo("sharedEmail");
foreach (ExchangeFolderInfo fi in client.ListSubFolders(mi.RootUri))
    if (fi.DisplayName.Equals("sureshtest"))
        foreach (var m in client.ListMessages(fi.Uri))

It’s worked for me. Thanks you so much.


It’s good to know that suggested option worked on your end.

1 Like