Read POP3 email using C#
Hi, few days ago I thought it is not a problem to connect and download emails from a pop3 email with SSL enabled (like gmail). But after 3 days of searching, I'am not able to connect to POP3 SSL email, and able to connect to POP3 notSSL only thru OpenPOP LGPL library...
Only thing I need, is a piece of code, that will connect me to my POP3 email account and download messages, so I can see how the hell is it working... (i need only the name of who sent the message and text of message, thats all).
I'll do almost anythng for explaining me this :) Thanks for any comments.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Bechir BejaouiRank #144 · 15.9K pointsPosted Dec 7, 2008, 11:28 AM EST
This is a complete example of how to use POP3
Festar6 pointsPosted Mar 17, 2016, 5:15 AM EDT
using (PopClient pop = new PopClient("<ADDRESS>")) { // Connect and login to email server. pop.Connect(); pop.Authenticate("<USERNAME>", "<PASSWORD>"); // Download and receive first email message available on server. MailMessage message = pop.GetMessage(1); // Read and display email's subject and message. Console.WriteLine(message.Subject); Console.WriteLine(message.BodyHtml); }