Hello,
I am having trouble getting any results back from the imap_search function. I assume it has to do with getting the right query string.
I am grabbing a string of keywords from an HTML form input box, and (trying to) search the IMAP inbox for messages which contain the $keywords string in either the BODY or the SUBJECT. Can anyone lend some help with the correct string to send to the server? I keep getting nothing back, meaning that the server doesn't understand the query.
$link = imap_open($server, $UN, $PW) or die(imap_last_error());
$matches = imap_search($link, "BODY \"$keywords\" SUBJECT \"$keywords\"");
if ($matches === false)
{
echo "Server didn't understand query.<p>";
echo imap_last_error();
}
Thanks,
Jeff