Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Connect to POP3 in C#
// Create an instance of the Pop3Client class
Pop3Client client = new Pop3Client("pop.domain.com", "username", "password");
// Create and configure HttpProxy
HttpProxy proxy = new HttpProxy("18.222.124.59", 8080);
client.Proxy = proxy;
// Get mailbox information
Pop3MailboxInfo mailboxInfo = client.GetMailboxInfo();
// Create an instance of the Pop3Client class
Pop3Client client = new Pop3Client("pop.domain.com", "username", "password");
// Set proxy address
string proxyAddress = "192.168.203.142";
// Specify port number
int proxyPort = 1080;
// Create an instance of SocksProxy and configure it
SocksProxy proxy = new SocksProxy(proxyAddress, proxyPort, SocksVersion.SocksV5);
client.Proxy = proxy;
// Get mailbox information
Pop3MailboxInfo mailboxInfo = client.GetMailboxInfo();
// Create an instance of the Pop3Client class
Pop3Client client = new Pop3Client();
// Specify host, username, password, Port and SecurityOptions for your client
client.Host = "pop.gmail.com";
client.Username = "your.username@gmail.com";
client.Password = "your.password";
client.Port = 995;
// For SSL-enabled POP3 server
client.SecurityOptions = SecurityOptions.SSLAuto;
// Print message after connection
Console.WriteLine(Environment.NewLine + "Connected to POP3 server.");
// Create an instance of the Pop3Client class
Pop3Client client = new Pop3Client();
// Specify host, username, password, Port and SecurityOptions for your client
client.Host = "pop.gmail.com";
client.Username = "your.username@gmail.com";
client.Password = "your.password";
client.Port = 995;
client.SecurityOptions = SecurityOptions.Auto;
// Print message after connection
Console.WriteLine(Environment.NewLine + "Connected to POP3 server.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment