Login  
Search All Forums
Dart Home | PowerTCP Mail for .NET | Custom Development Reply | PowerTCP Mail for .NET Topics | Forums   
AuthorForum: PowerTCP Mail for .NET
Topic: Messages count for subfolder mailboxes
gkohli

From: Canada
Posts: 13
Member Since: 10/08/15
posted September 8, 2016 10:13 AM

Hi I am not getting the Message count for my subfoloder mailboxes,, is there anything special need to be done
suppose
INBOX
INBOX/NEWITEMS

i get the count on INBOX but not on the subfolder

 if (box.Name.Equals("INBOX", StringComparison.InvariantCultureIgnoreCase)
 {
 box.Mailboxes.Refresh();
  if (box.Mailboxes.Count > 0)
   {
   foreach (var item in box.Mailboxes)
    {
             
    dr = dtMailboxes.NewRow();
   dr[0] = item.FullName;
   dr[1]= "(" + item.Count + ")";
   dtMailboxes.Rows.Add(dr);
   }
   }
Please advise
Thanks
Nick B (Admin)

From: Utica, NY USA
Posts: 576
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted September 8, 2016 2:47 PM

Hello,

In order to populate a mailbox's message count, the mailbox must be selected. You can either select the Mailbox object representing the mailbox:
http://www.dart.com/help/ptmlnet/webframe.html#Dart.Mail~Dart.Mail.Imap~SelectedMailbox.html

Or by string path:
http://www.dart.com/help/ptmlnet/webframe.html#Dart.Mail~Dart.Mail.Imap~Select.html

If you have a populated count for INBOX, that suggests that you have previously selected the INBOX in your code.
Reply | PowerTCP Mail for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX