Hello,
I'm having trouble with the imap_search function. I'm attempting to search for keywords in either the subject or body parts of messages on the IMAP server. I haven't been able to get any results back, which I assume means that I'm structuring my query string wrong, because it seems the server doesn't understand. Can anyone help me with the correct function call?
$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 the query.<p>";
echo imap_last_error();
}
Well, I keep getting the "Server didn't understand..." bit, but imap_last_error isn't producing any output...
Any ideas?
Thanks,
Jeff