Looking for a POP3 Client for .NET that basically just lets me log into a server and grab all the emails out, and maybe send some. I grabbed Indy.Sockets off of CodePlex and got it running but its throwing errors trying to decode the mail headers. Really anything is fine if it works.
I use the one of Peter Huber. Has worked quite well for me. (Large amounts of mail > 2k in a batch)
http://www.codeproject.com/KB/IP/Pop3MailClient.aspx
Good luck!
Hi, as I wrote in the answer to the similar question (Reading Email using Pop3 in C#) the downloading message via the POP3 is the easy part of this task. The parsing of the message is much harder. Handling UNICODE, mangled emails/spams, internationalization issues, code for auto correction of errors which came from Outlook and Thunderbird and testing on big pile of messages is quite time consuming and takes a few months of development time.
I would try the code from the codeproject and if it suits your needs stick with it. In case of too many parsing problem the commercial email component with decent support could be a wise move. I would recommend our Rebex Mail ($149 single dev) but I'm biased. Feel free to browse for you own favorite ;-). At least it will be (in case of any problem) someone who is paid for solving your mail parsing problem.
Martin
My open source .NET application BugTracker.NET includes code for a POP3 client and code for parsing MIME. Both are actually borrowed from elsewhere. The MIME code is from SharpMimeTools. But you can see how it all works together in app.
See the files POP3Client.cs, POP3Main.cs, and insert_bug.aspx
Check out Lumisoft, it's open source and has many features
Try Mail.dll .NET email component. It's not free, but also not expensive.
It gives you a nice object structure of an entire email message. It has SSL support, POP3, IMAP and SMTP clients for sending and receiving.
using(Pop3 pop3 = new Pop3())
{
pop3.Connect("mail.host.com"); // Connect to the server
pop3.Login("user", "password"); // and login
foreach(string uid in pop3.GetAll())
{
// Receive mail
IMail mail = new MailBuilder()
.CreateFromEml(pop3.GetMessageByUID(uid));
// Write out received mail message
Console.WriteLine( mail.Subject );
Console.WriteLine( mail.TextDataString );
}
pop3.Close(true);
}
Please note that this is a commercial product I've created.
You can download it here: http://www.lesnikowski.com/mail.
I've used C#Mail on a project before and it works great. There's very little documentation, but it's easy to discover functionality through Intellisense.
There's two things to keep in mind, however:
- The SMTP functionality is incomplete. I don't see this one as much of a problem considering that .NET provides a pretty good SMTP library natively.
- The parameter
Pop3Client.Available
is set to true when it connects, but it doesn't poll to check if the connection remains that way. Thus, if you leave the connection open for a while, the server might disconnect your client, but theAvailable
flag will still be true.
C#Mail cited above is GNU GPL. Just a warning so that you make sure GPL will be appropriate for your use, instead of just assuming anything hosted on codeplex is BSD like.
Check out ReadyPOP. They have a free version, and the paid version is very inexpensive and includes attachments and SSL support.