Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active November 28, 2023 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aspose-com-gists/141797c6552408d82eec15a0c9faa33a to your computer and use it in GitHub Desktop.
Save aspose-com-gists/141797c6552408d82eec15a0c9faa33a to your computer and use it in GitHub Desktop.
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