number of emails in inbox
Moderator: General Moderators
number of emails in inbox
does anyone know how to get the number of emails in the inbox using the imap functions?
Re: number of emails in inbox
i figured it out in case someone might need this later
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;
}
}
?>
Re: number of emails in inbox
There are 10 types of people in this world, those who understand binary and those who don't