number of emails in inbox
Posted: Mon Oct 27, 2008 2:38 pm
does anyone know how to get the number of emails in the inbox using the imap functions?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$imap = imap_open($account, $emailuser, $emailpass)
$headers = imap_headers($imap);
$counter=0;
if (!$headers) {
print "Failed to retrieve headers\n";
}
else {
foreach($headers as $header) {
$counter=$counter+1;
}
}
?>