Author |
|
steve77 Newbie
Joined: 08 January 2007
Online Status: Offline Posts: 1
|
Posted: 08 January 2007 at 4:30pm | IP Logged
|
|
|
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 |
|
|
Andrew AfterLogic Support
Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 09 January 2007 at 6:22am | IP Logged
|
|
|
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 |
|
|