This example demonstrates how to retrieve the amount of space left in the user's inbox. Notice that this feature is not supported by all IMAP servers and some servers may just return 0.

Determining the amount of free space left in the user's inbox.

CopyC#
using System;
using S22.Imap;

namespace Test {
    class Program {
        static void Main(string[] args)
        {
            using (ImapClient client = new ImapClient("imap.gmail.com", 993, "username",
              "password", AuthMethod.Login, true))
            {
                MailboxStatus status = client.GetStatus();

                Console.WriteLine(status.FreeStorage + " Bytes left");
                Console.WriteLine(status.UsedStorage + " Bytes used");
            }
        }
    }
}