Author |
|
niklas Newbie
Joined: 08 November 2008 Location: Sweden
Online Status: Offline Posts: 15
|
Posted: 08 November 2008 at 2:35am | IP Logged
|
|
|
Hi,
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.
Ex.
> Inbox
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
Else
End If
objIMAP4.Disconnect
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 10 November 2008 at 4:04am | IP Logged
|
|
|
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.
Regards,
Igor
|
Back to Top |
|
|