ImapGetFolderStatus Method |
Gets the status of the specified folder without selecting it.
Namespace: MailBee.ImapMailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public FolderStatus GetFolderStatus(
string folderName
)
Public Function GetFolderStatus (
folderName As String
) As FolderStatus
Parameters
- folderName
- Type: SystemString
The full name of the folder to get the status information of.
Return Value
Type:
FolderStatusFolderStatus object if the status information was downloaded successfully; otherwise, a null reference (
Nothing in Visual Basic).
Exceptions Remarks
This method can be used to obtain the folder status information such as total count of messages, recent messages count, unseen messages count, etc without
selecting the folder.
Examples This sample gets Inbox status information and displays unseen messages count. No folder is selected.
using System;
using MailBee;
using MailBee.ImapMail;
class Sample
{
static void Main(string[] args)
{
Imap imp = new Imap();
imp.Connect("imap.server.com");
imp.Login("jdoe@server.com", "secret");
FolderStatus status = imp.GetFolderStatus("Inbox");
Console.WriteLine(status.UnseenCount + " unseen message(s) in inbox");
imp.Disconnect();
}
}
}
Imports System
Imports MailBee
Imports MailBee.ImapMail
Module Sample
Sub Main()
Dim imp As New Imap
imp.Connect("imap4.company.com")
imp.Login("jdoe@company.com", "secret")
Dim status As FolderStatus = imp.GetFolderStatus("Inbox")
imp.Disconnect()
End Sub
End Module
See Also