imap_search
(PHP 4, PHP 5)
imap_search — 이 함수는 주어진 검색 기준(criteria)에 부합되는 메시지의 배열을 돌려준다
Description
array imap_search
( int $imap_stream
, string $criteria
, int $flags
)
이 함수는 주어진 imap 스트림(stream)안의 현재 열려있는 메일박스에서 검색을 수행한다. criteria 인수는 문자열이다. 공백(spaces)에 의해 구별(delimited)되고,아래의 키워드(keywords)가 허용된다. 두 단어 이상의 변수(arguments) (예를 들면, FROM "joey smith" )는 따옴표(quoted) 처리해야 한다.
- ALL - return all messages matching the rest of the criteria
- ANSWERED - match messages with the \\ANSWERED flag set
- BCC "string" - match messages with "string" in the Bcc: field
- BEFORE "date" - match messages with Date: before "date"
- BODY "string" - match messages with "string" in the body of the message
- CC "string" - match messages with "string" in the Cc: field
- DELETED - match deleted messages
- FLAGGED - match messages with the \\FLAGGED (sometimes referred to as Important or Urgent) flag set
- FROM "string" - match messages with "string" in the From: field
- KEYWORD "string" - match messages with "string" as a keyword
- NEW - match new messages
- OLD - match old messages
- ON "date" - match messages with Date: matching "date"
- RECENT - match messages with the \\RECENT flag set
- SEEN - match messages that have been read (the \\SEEN flag is set)
- SINCE "date" - match messages with Date: after "date"
- SUBJECT "string" - match messages with "string" in the Subject:
- TEXT "string" - match messages with text "string"
- TO "string" - match messages with "string" in the To:
- UNANSWERED - match messages that have not been answered
- UNDELETED - match messages that are not deleted
- UNFLAGGED - match messages that are not flagged
- UNKEYWORD "string" - match messages that do not have the keyword "string"
- UNSEEN - match messages which have not been read yet
예를 들어 Mom으로 부터 받은 아직 읽지 않은 모든 메시지를 검색하려면, 다음과 같이 하면 된다: "UNANSWERED FROM mom". 검색은 대소문자 구별을 하지 않는 것처럼 보인다. 검색기준의 목록은 UW c-client source code에 달려있어서 불완전하거나 부정확할 수 있다. (RFC2060, section 6.4.4 도 보시라).
플래그(flags)에 대한 유효한 값은 SE_UID이다. 이것은 메시지 일련번호(sequence number)대신에 UID를 포함하는 배열을 돌려준다.