ImapGetFolderQuota Method |
Namespace: MailBee.ImapMail
Exception | Condition |
---|---|
MailBeeProtocolExtensionNotSupportedException | QUOTA not supported by the server and ThrowExceptions is true. |
MailBeeException | An error occurred and ThrowExceptions is true. |
This method can be used to obtain the folder quota information such as maximum allowed size of the folder, the current size of the folder, etc.
To get the quota set for the entire account on the IMAP4 server, the developer can use GetAccountQuota method.
Note |
---|
This method uses QUOTA capability be supported by the IMAP4 server. The developer can check if QUOTA capability is supported using GetExtension(String) method. |
using System; using MailBee; using MailBee.ImapMail; class Sample { static void Main(string[] args) { Imap imp = new Imap(); // Connect to the server and log in the account. imp.Connect("mail.company.com"); imp.Login("jdoe@company.com", "secret"); if (imp.GetExtension("QUOTA") != null) { // Download Inbox folder quota information. FolderQuota quota = imp.GetFolderQuota("Inbox"); if (quota.MaxStorageSize > -1) { Console.WriteLine(quota.MaxStorageSize + " is the maximum allowed total size (in bytes) " + "of all messages in the folder."); } } else { Console.WriteLine("QUOTA capability not supported, sorry"); } imp.Disconnect(); } }