|
imap_search
This function returns an array of messages matching the given search criteria
(PHP 4, PHP 5)
This function performs a search on the mailbox currently opened in the given imap stream. For example, to match all unanswered messages sent by Mom, you'd use: "UNANSWERED FROM mom". Searches appear to be case insensitive. This list of criteria is from a reading of the UW c-client source code and may be incomplete or inaccurate (see also » RFC2060, section 6.4.4). Parameters
Return ValuesReturns an array of message numbers or UIDs.
Return
See Also
Code Examples / Notes » imap_searchadmin
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
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"; |
Change Languageimap_8bit imap_alerts imap_append imap_base64 imap_binary imap_body imap_bodystruct imap_check imap_clearflag_full imap_close imap_createmailbox imap_delete imap_deletemailbox imap_errors imap_expunge imap_fetch_overview imap_fetchbody imap_fetchheader imap_fetchstructure imap_get_quota imap_get_quotaroot imap_getacl imap_getmailboxes imap_getsubscribed imap_header imap_headerinfo imap_headers imap_last_error imap_list imap_listmailbox imap_listscan imap_listsubscribed imap_lsub imap_mail_compose imap_mail_copy imap_mail_move imap_mail imap_mailboxmsginfo imap_mime_header_decode imap_msgno imap_num_msg imap_num_recent imap_open imap_ping imap_qprint imap_renamemailbox imap_reopen imap_rfc822_parse_adrlist imap_rfc822_parse_headers imap_rfc822_write_address imap_savebody imap_scanmailbox imap_search imap_set_quota imap_setacl imap_setflag_full imap_sort imap_status imap_subscribe imap_thread imap_timeout imap_uid imap_undelete imap_unsubscribe imap_utf7_decode imap_utf7_encode imap_utf8 |