imap_search returns both read and unread messages
Posted: Tue Jan 12, 2010 3:59 am
I am using the imap_search function to return an array of unseen messages but all the messages are returned. I only want to show unread messages but the code returns all the messages (numbers) in the mailbox.
Thanks in advance for your help.
Below is the code.
Thanks in advance for your help.
Below is the code.
Code: Select all
$result = imap_search($imap,'UNSEEN');
foreach ($result as $value) {
echo " the unseen message number is";
echo "<br>";
echo $value;
echo "<br>";
}