« My own private Los Angeles | Main | Using Outlook to import emails to Exchange is painfully slow »



hey thanks for this: btw, on macosx you can use MAMP to do localhost dev and testing - it's built with the imap lib out of the box.. and free! much nicer than the whole yak shaving rigmarole of appleapache..

Pete Warden

Thanks Jeremy, that is a good suggestion, I've been meaning to check out MAMP. At the moment I've fallen back to remote development, but it's definitely slower.


Good stuff!

I was looking for an API to connect to Gmail for monitoring purposes (count emails) and indeed IMAP does the trick simply and efficiently.

So I used imap_status() to retrieve the total message count, as well as the unread (unseen) one. Code is merely:

foreach ($folders as $box) {
$status = imap_status($connection, $box, SA_ALL);
echo substr($box,strlen($imapaddress))." ( ".$status->unseen." unread, ".$status->messages." total)";

Thanks for the tip!

The comments to this entry are closed.