Search The ForumSearch   RegisterRegister  LoginLogin

MailBee IMAP4

 AfterLogic Forum : MailBee IMAP4
Subject Topic: Count unread messages in subfoldes as wel Post ReplyPost New Topic
Message << Prev Topic | Next Topic >>

Joined: 08 November 2008
Location: Sweden
Online Status: Offline
Posts: 15
Posted: 08 November 2008 at 2:35am | IP Logged Quote niklas


I manage to create the script to get all the unread messages in the mailbox "Inbox". But I have several sub folders in the inbox folder and some emails are forwarded into these sub folders.


> Inbox

    > Webb
    > Other
    > Logins

If I have unread messages in the folder Webb it wont be counted in the script.

Please can you help me. I use regular asp code.

Dim objIMAP4, objMsg

Set objIMAP4 = Server.CreateObject("MailBee.IMAP4")

objIMAP4.LicenseKey = "xxxx"
objIMAP4.ServerName = "xxxx"
objIMAP4.UserName = "xxxx"
objIMAP4.Password = "xxxx"

If objIMAP4.Connect Then

     objIMAP4.SelectMailbox "Inbox"

     Response.Write objIMAP4.MessageCount & " messages in Inbox<br>"

     arrNew = objIMAP4.Search(False, "UNSEEN")

     Response.Write UBound(arrNew) - LBound(arrNew) + 1


End If

Back to Top View niklas's Profile Search for other posts by niklas
AfterLogic Support
AfterLogic Support

Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 10 November 2008 at 4:04am | IP Logged Quote Igor

We've replied to your request sent via Request Support form.

This is an expected behavior, as messages of Inbox subfolder don't count towards number of messages in Inbox folder itself.

If you need to calculate number of messages in Inbox folder and its subfolders (and their subfolders and so on), you need to retrieve list of subfolders recursively and process every subfolder.

You may use RetrieveMailboxes method to get the list of all mailboxes (i.e. folders) on your IMAP account.

Back to Top View Igor's Profile Search for other posts by Igor

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide