Page 1 of 1

imap_search returns both read and unread messages

Posted: Tue Jan 12, 2010 3:59 am
by nathionice
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.

Code: Select all

$result = imap_search($imap,'UNSEEN');
 
foreach ($result as $value) {
 
echo " the unseen message number is";
echo "<br>";
echo $value;
echo "<br>";
}

Re: imap_search returns both read and unread messages

Posted: Tue Jan 12, 2010 11:40 pm
by Christopher
What do you get if you use SEEN?