Last active
November 28, 2023 15:00
-
-
Save aspose-com-gists/141797c6552408d82eec15a0c9faa33a to your computer and use it in GitHub Desktop.
Connect to POP3 in C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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