How to Import emails from external email server using C#
Hi,
I'm new to .net. I'm finding difficulty in figuring out how to Import emails from external email servers using C# ... I want to access any extern mail server to import email addresses from it ... Kindly Please guide me !!!
I will really appreciate your help ... Looking forward for your feedback
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Roei BarRank #1,271 · 1.4K reputationPosted Nov 1, 2009, 8:28 AM EST
using (Pop3Client cl = new Pop3Client()) { cl.UserName = "MyUserName"; cl.Password = "MyPassword"; cl.ServerName = "MyServer"; cl.AuthenticateMode = Pop3AuthenticateMode.Pop; cl.Ssl = false; cl.Authenticate(); ///Get first mail of my mailbox Pop3Message mg = cl.GetMessage(1); String MyText = mg.BodyText; ///If the message have one attachment Pop3Content ct = mg.Contents[0]; ///you can save it to local disk ct.DecodeData("your file path"); }you can get it from codeplex
http://csharpmail.codeplex.com/
or you can use this
// // create client, connect and log in Pop3 client = new Pop3(); client.Connect("pop3.example.org"); client.Login("username", "password"); // get message list Pop3MessageCollection list = client.GetMessageList(); if (list.Count == 0) { Console.WriteLine("There are no messages in the mailbox."); } else { // download the first message MailMessage message = client.GetMailMessage(list[0].SequenceNumber); ... } client.Disconnect();hope your help!