public static void Run() { // Create an instance of the Pop3Client class //ExStart:GettingMailboxInfo Pop3Client client = new Pop3Client(); // Specify host, username, password, Port and SecurityOptions for your client client.Host = "pop.gmail.com"; client.Username = "******"; client.Password = "******"; client.Port = 995; client.SecurityOptions = SecurityOptions.Auto; // Get the size of the mailbox, Get mailbox info, number of messages in the mailbox long nSize = client.GetMailboxSize(); Console.WriteLine("Mailbox size is " + nSize + " bytes."); Pop3MailboxInfo info = client.GetMailboxInfo(); int nMessageCount = info.MessageCount; Console.WriteLine("Number of messages in mailbox are " + nMessageCount); long nOccupiedSize = info.OccupiedSize; Console.WriteLine("Occupied size is " + nOccupiedSize); //ExEnd:GettingMailboxInfo Console.WriteLine(Environment.NewLine + "Getting the mailbox information of POP3 server."); }
public static void Run() { //ExStart: AccessMailboxViaHTTPProxy HttpProxy proxy = new HttpProxy("18.222.124.59", 8080); using (Pop3Client client = new Pop3Client("imap.domain.com", "username", "password")) { client.Proxy = proxy; Pop3MailboxInfo mailboxInfo = client.GetMailboxInfo(); } //ExEnd: AccessMailboxViaHTTPProxy }
public static void Run() { // ExStart:RetrieveEmailViaPop3ClientProxyServer Pop3Client client = new Pop3Client("pop.domain.com", "username", "password"); // Set proxy address, Port and Proxy string proxyAddress = "192.168.203.142"; int proxyPort = 1080; SocksProxy proxy = new SocksProxy(proxyAddress, proxyPort, SocksVersion.SocksV5); client.Proxy = proxy; try { Pop3MailboxInfo mailboxInfo = client.GetMailboxInfo(); } catch (Exception ex) { Console.WriteLine(ex.Message); } // ExEnd:RetrieveEmailViaPop3ClientProxyServer }