Check POP3 Email with PHP

There’s going to come a time in your life when you’ll want to check an email account using PHP. Trust me on this. You’ll want to add an unread message counter to an intranet project, write a “Post via Email” module to your custom built CMS or even, God forbid, write your own webmail application.

When this day comes you’re going to want to use the PHP POP3 Class by Manuel Lemos. It’s available on the awful looking and barely functional PHP Classes site at: http://www.phpclasses.org/browse/package/2.html

This baby does it all. The example file is a bit of a mess but you can hack out a lot of the debug code quickly and easily to make it more manageable. You’ll be up and running in minutes.

March 8th, 2007 | PHP, Programming | 11 Comments
While you're worrying about the backend of your site it's vital to keep in mind the importance of good web design. Since the design of your site is one the most critical parts of the web development process make sure you pick a designer with a very strong web site design portfolio.

11 Comments

  1. Hi, that was useful, but anyway to manage SSL connections? I want to fetch from gmail account :(

    Thanks!

    Comment by Oil Paintings — June 29, 2008 @ 12:03 pm

  2. It seems that this class does have SSL support :) You should just add the openssl extension in the php.ini file, great! Thanks again

    Comment by Oil Paintings — June 30, 2008 @ 5:44 am

  3. :) I totally agree with the “awful looking and barely functional” part

    Comment by Can — February 18, 2009 @ 4:47 pm

  4. Does anyone has a copy or point me to the download link? Manuel’s site doesnt seem to be working.

    Comment by Anil Anand — March 9, 2009 @ 1:29 am

  5. Much easier than trying to understand PHP’s built in IMAP Functions. Thanks for the referral!

    Comment by Mike Frank — September 1, 2009 @ 3:34 pm

  6. I refuse to use the site because of the forced registration before download is made clear until you try to get the file. It’s a shame because other than that this might have been very useful.

    Comment by Lord Matt — September 27, 2009 @ 8:56 am

  7. Matt,

    For your registration problem, try using bugmenot [Google it], it works.

    Comment by Mojo — September 28, 2009 @ 1:25 pm

  8. Bugmenot with phpclasses doesn’t work very well. They have shut them all down that I’ve tried.

    Personally it pisses me off that one must register to download the files. I have always looked for alternatives when a search lead me to phpclasses…

    Comment by Dustin — October 18, 2009 @ 1:10 am

  9. I’ve also come to the stage in my life where I want to check a POP3 e-mail account. So I’ll give this class a go. Thanks for the recommendation.

    Comment by Daniel Martin — January 3, 2010 @ 10:09 am

  10. Don’t bother using classes unless you have no access to compiling Apache /w IMAP support (which also can connect to pop3).

    Check out http://ca3.php.net/manual/en/book.imap.php for more info.

    Saved me much hassle knowing there are functions that can be compiled in.

    Comment by OldNews — February 18, 2010 @ 5:55 pm

  11. This looks like just what I was looking for. I was hoping to be able to use it with Gmail to be able to “reset” the downloaded message marker by setting the “Download All Mail” in Gmail and then incrementing the downloaded message marker up to a certain date.

    Anyone have any good ideas on how to do this?

    Comment by Tom — June 21, 2010 @ 2:39 pm

Leave a comment...