PHP imap_sort has an undocumented $search_criteria parameter. I’m writing a little script that should fetch mail containing a PIN code (five digits) in subject. Eventually not interested in any other mail. How can i specify my filter rule?
array imap_sort ( resource $imap_stream , int $criteria , int $reverse [, int
$options = 0 [, string $search_criteria = NULL [, string $charset = NIL ]]] )
Not true. It is documented. But obviously not at this function.
Better function for mail searching is imap_search (it has documented $criteria). Search criteria is also defined in RFC 1176 (page 15 & 16).
Next thing is, that you cannot search with pattern, only string, so this will not work for you. I propose, that you fetch all e-mails, and compare subject that you need. You can limit your search by date…