Search The ForumSearch   RegisterRegister  LoginLogin

MailBee IMAP4

 AfterLogic Forum : MailBee IMAP4
Subject Topic: Count Unread mails Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
steve77
Newbie
Newbie
Avatar

Joined: 08 January 2007
Online Status: Offline
Posts: 1
Posted: 08 January 2007 at 4:30pm | IP Logged Quote steve77

Hi

I am using the trial version of IMAP4.
I can get the number of unread mail by using Imap4.Search(False,"UNSEEN").
However, when I tried to use Imap4.RecentCount , it always return 0.

Thanks

steve
Back to Top View steve77's Profile Search for other posts by steve77
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 09 January 2007 at 6:22am | IP Logged Quote Andrew

You can get number of unseen messages as follows:

Code:
SearchResults = Imap4.Search(False,"UNSEEN")

UnseenCount = UBound(SearchResults) - LBound(SearchResults) + 1


RecentCount property contains the number of the messages with "Recent" flag in currently selected mailbox without performing Imap4.Search. But "Recent" flag is reset after each opening the mailbox in read-write mode by any application. For instance, if your application (or any other application) has opened the mailbox via SelectMailbox method, it can see messages marked with "Recent" flag, but this flag will be reset after the connection gets terminated, thus, the subsequent connections won't see any messages marked with "Recent" flag until other new messages arrive into the mailbox. Thus, "Recent" is disposable flag, while "Unseen" remains between different connections until the messages are downloaded explicitly.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 

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