Integrating POP3 client functionality into a C# application?

女生的网名这么多〃 提交于 2019-11-28 02:55:15

I am one of the main developers of OpenPop.NET. I just fell over this review, and had to come with some comments regarding the current state of OpenPop.NET as the review seems outdated with the development.

OpenPop.NET is back into active development. SSL has been introduced a half year back. The project had a major refactoring and is now much more stable and easy to use. When I took over the project it had a lot of bugs in it, and as of now I currently know none. A lot of extra features have been implemented, mainly in the MIME parser part. The project is backed by unit tests, and each time a bug is found, a unit test is created to show this bug before fixing it. An accompanying website with examples now exists. There has also been other updates, but I do not want to mention them all.

Also, OpenPop.NET's license has been changed from LGPL to Public Domain (aka, no restrictions). This I think is a major improvement for commercial users.

I did an implementation of OpenPop for a project recently, and was happy with it. It does what it says on the tin. (and it's free.)

The constructor of SslStream class was modified and uploaded. Recommended version have no problem to use.

C# Mail is available on Codeplex and is pretty easy to use.

You may want to include Mail.dll .NET mail component in your ranking. It has SSL support, Unicode, and multi-national email support:

using(Pop3 pop3 = new Pop3())
{
    pop3.Connect("mail.host.com");      // Connect to server
    pop3.Login("user", "password");     // Login

    foreach(string uid in pop3.GetAll())
    {
        IMail email = new MailBuilder()
   .CreateFromEml(pop3.GetMessageByUID(uid));

        Console.WriteLine(email.Subject);
    }
    pop3.Close(true);  
}

IMAP protocol is also supported.

Please note that this is a commercial product I've created.

You can download it here: http://www.lesnikowski.com/mail

A new option (as of 2014) is MailKit from Xamarin, available under the MIT license. It parses messages from disk 25x faster than OpenPOP.NET. It includes support of IMAP, POP3, and SMTP and seems to be very fast and robust.

Jmail.NET. Don't look further. Note that the free version doesn't include POP3. You'll want to take the Standard version (or more). Don't worry, it's not expensive.

DasBlog uses a good (and free) one - grab the source package. I've used it (but I can't remember who wrote it, and I'm not on my laptop - Pavel L I think?). It's not perfect, and it doesn't do SSL, but it works nicely otherwise.

Take a look at the POP3 integration in my open source app BugTracker.NET at http://ifdefined.com/bugtrackernet.html. All free and open source. The hardest part, the mime parsing, is done in BugTracker.NET by SharpMimeTools at http://anmar.eu.org/projects/sharpmimetools/

The important files that show how I'm using the POP3 and MIME logic are POP3Client.cs and insert_bug.aspx.

I made my own Mime parser and added it to CodePlex because I kept running into unhandled exceptions with the other ones when it came to strange encodings og weird combinations of attachments. The pop3 client implementation is crude, just made for testing purposes, but handles that ok. The Mime parser part populates the standard MailMessage object, so that you can easily forward it at it is. I can expand/improve it on request, but for now it does the job ok for my needs. Feel free to check it out.

http://www.codeplex.com/mimeParser

Lumisoft is open-source and includes a POP client (among other stuff). It's been around for many years, very stable.

If you need SSL to access gmail.. here is some modifications to the OpenPOP.net library that gives it SSL support.

OpenPop.net modified to include SSL support for accessing Gmail

Joachim Kerschbaumer

There are several POP3 client implementations around at codeproject.com. I have not evaluated them, but maybe you can find what you need there. If not, I can say that POP3 is quite a simple protocol. You can even read your POP3 box with telnet if you know 4-5 commands.

You actually just need this commands and maybe some base64 decoding for attachments. That's it.

Since I had to automate some email processing things. I took OpenPop.net I was searching how I could forward mailmessages with this library and came across this amazing function: http://hpop.sourceforge.net/documentation/OpenPop~OpenPop.Mime.Message.ToMailMessage.html

to summarize, I have chosen OpenPop.Net and recommend it!

best regards, JP

If you don't mind paying for a component, we've had great success with chilkat in the past. For a couple of hundred bucks you get a library that's jam packed full of goodness.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!