So this solution takes OpenPop.net Open source library and makes some very small tweaks so it has Ssl support.
Here is the important simple code snippet.
Stream actualstream = clientSocket.GetStream(); if (useSSL) { System.Net.Security.SslStream sslstream = new SslStream(clientSocket.GetStream()); sslstream.AuthenticateAsClient(strHost); actualstream = sslstream; }
Attached here is the re zip of the source code with the change to the library and also a tweak to the sample app with a checkbox to include SSL support.
OpenPOP with SSL Source Download
OpenPOP with SSL Binaries Download
Enjoy!
10 comments:
You links for re zip don't work
Thanks for letting me know about the broken links, they should be fixed now. Happy Emailing!
Thanks alot from Germany
Thanks its working for gmail . How to connect to my companies exchange server . i am getting
"The handshake failed due to an unexpected packet format."
Hey Sriram,
Sorry, I don't know exactly what causes that error: Here is an article I found, if you find out what the fix is if you could post it here that would be great and I might even be able to change my library to include it
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_CSharp/Q_23770445.html
http://social.msdn.microsoft.com/Forums/en/ncl/thread/e8807c4c-72b6-4254-ae64-45c2743b181e
Hey!
Nice work!I've managed to access my gmail account with it. There is one problem which i can not solve.
I can only check the unread messages. How can i access the read ones? Or the sent ones?
Cheers,
ati
Hey Sdf,
As far as reading the read mail. This is how gmail implemented the pop3 interface to their mail server.
I did find there is a setting in gmail for whether or not accessing it. I don't know if it actually helps though.
http://www.justinkbeck.com/random_images/pop_gmail.png
Justin
Well its not about that setting, because it was already enabled.
Your program works well but once an email is retrieved it will not be retrieved anymore.
That's how i meant that i can only access the unread emails but not the read or sent etc ones.
sdf - that is how the GMail POP works... they automatically "remove" the messages from server for you... when I say "remove" I mean they are not accessible via POP after that... I noticed this behavior a few years ago when I was using POP to get my GMail via e-mail clients on different computers. IMAP is probably the "easiest" way to do what you want, but don't know if there is a free/open source class out there that will do IMAP.
Impressive and powerful suggestion by the author of this blog are really helpful to me. k7 lifetime antivirus
Post a Comment