downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

imap_set_quota> <imap_scanmailbox
[edit] Last updated: Fri, 23 Mar 2012

view this page in



imap_set_quota> <imap_scanmailbox
[edit] Last updated: Fri, 23 Mar 2012
 
add a note add a note User Contributed Notes imap_search
Brett 14-May-2012 09:45
I haven't found any documentation of the allowed date formats, but (for example) "14 May 2012" works.

// Find UIDs of messages within the past week
$date = date ( "d M Y", strToTime ( "-7 days" ) );
$uids = imap_search ( $mbox, "SINCE \"$date\"", SE_UID );
joseph dot cardwell at jbcwebservices dot com 26-Mar-2012 07:07
imap_search() always returns false when op_silent flag is set in the connection parameters.
admin at rancid-tea dot com 20-Sep-2007 10:57
This search looks for messages matching ALL criteria, not ANY criteria. For example the search

imap_search($mailbox,'FROM "user" TO "user"')

Will return message that have "user" in both the from and to headers, but not messages with "user" in either the from or to header.
oliver at samera dot com dot py 26-Oct-2002 10:16
imap_search() only supports IMAP2 search criterias, because the function mail_criteria() (from c-client lib) is used in ext/imap/php_imap.c for parsing the search string.
IMAP2 search criteria is defined in RFC 1176, section "tag SEARCH search_criteria".
oliver at samera dot com dot py 26-Jan-2002 10:03
imap_search() return false if it does not understand the search condition or no messages have been found.

$emails imap_seach($mbox, "UNDELETED SENTSINCE 01-Jan-2002");
if($emails === false)
  echo "The search failed";

 
show source | credits | sitemap | contact | advertising | mirror sites