Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
Email .NET
>
Tutorial
> Get mailbox details
This example shows you how to login to POP3 server and get mailbox details.
C# example
using System; using Independentsoft.Email; using Independentsoft.Email.Pop3; namespace Sample { class Program { static void Main(string[] args) { Pop3Client client = new Pop3Client("pop3.live.com", 995); client.Connect(); client.Login("example@hotmail.com", "password"); MailboxInfo mailboxInfo = client.GetMailboxInfo(); Console.WriteLine("The mailbox has " + mailboxInfo.Count + " messsage(s) and size of all messages is " + mailboxInfo.Size + " bytes"); client.Disconnect(); Console.WriteLine("Press ENTER to exit!"); Console.Read(); } } }
VB example
Imports System Imports Independentsoft.Email Imports Independentsoft.Email.Pop3 Namespace Sample Class Program Shared Sub Main(ByVal args As String()) Dim client As New Pop3Client("pop3.live.com", 995) client.Connect() client.Login("example@hotmail.com", "password") Dim mailboxInfo As MailboxInfo = client.GetMailboxInfo() Console.WriteLine("The mailbox has " & mailboxInfo.Count & " messsage(s) and size of all messages is " & mailboxInfo.Size & " bytes") client.Disconnect() Console.WriteLine("Press ENTER to exit!") Console.Read() End Sub End Class End Namespace