Count unread emails via POP3?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
DaveTheAve
Forum Contributor
Posts: 385
Joined: Tue Oct 03, 2006 2:25 pm
Location: 127.0.0.1
Contact:

Count unread emails via POP3?

Post by DaveTheAve »

So I'm using this class that will count the amount of email in the pop3 server but the problem is, not all emails in the pop3 account are new (unread).

My question is how do I tell if an email is read or not on a pop3 server?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Count unread emails via POP3?

Post by VladSun »

Open a connection to the POP3 server and implement POP3 protocol:
http://en.wikipedia.org/wiki/Post_Offic ... og_example
There are 10 types of people in this world, those who understand binary and those who don't
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Count unread emails via POP3?

Post by alex.barylski »

Use the IMAP API to connect to a pop3 server and read messages:

Code: Select all

$imap = imap_open ("{domain.com:110/pop3}INBOX", "user", "pass")
http://ca3.php.net/manual/en/ref.imap.php
Post Reply