Ultimate POP3 Component for .NET http://www.pop3component.net How to use POP3 Component in C#, VB.NET and ASP.NET posterous.com Sat, 19 Jun 2010 14:23:00 -0700 How to obtain mailbox information http://www.pop3component.net/how-to-obtain-mailbox-information http://www.pop3component.net/how-to-obtain-mailbox-information

The simplest way to obtain information about a specified mailbox is using GetMailboxInfo method. You only need to pass the mailbox name to the method. It returns a Pop3MailboxInfo object containing information about the mailbox you have requested.

The following steps will help you to do that using ComponentSoft Mail component:

C#

// Create a new instance of the Pop3Client class. Pop3Client client = new Pop3Client(); // 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. Pop3MailboxInfo info = client.GetMailboxInfo(); // 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();

VB.NET

' Create a new instance of the Pop3Client class. Dim client As New Pop3Client() ' 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. Dim info As Pop3MailboxInfo = client.GetMailboxInfo() ' 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()

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1901417/Logo.jpg http://posterous.com/users/5AqhTle47UWJ ATP Incorporated ATP Inc ATP Incorporated