Shows how to connect to a POP3 server and obtain information of the mailbox.
using System; using ComponentPro.Net.Mail; ... // Create a new instance of the Pop3 class. Pop3 client = new Pop3(); // Connect to the server. client.Connect("myserver"); // Or you can specify the POP3 port with // client.Connect("myserver", 110); // Login to the server. client.Authenticate("user", "password"); // Obtain mailbox information. Pop3MailboxStat info = client.GetMailboxStat(); // Print out some information. Console.WriteLine("Number of messages found: {0}", info.MessageCount); Console.WriteLine("Mailbox Size: {0}", info.Size); // Close the connection. client.Disconnect();