이 함수는 주어진 메시지의 구조화된 모든 정보를 페치한다. 선택적 인수flags는 오직 하나의 옵션만 있다. 즉, msg_number를 UID로 취급할것인지 함수에게 알려주는 FT_UID의 옵션만 있다. 리턴된 객체는 envelope, internal date, size, flags와 각 mime첨부파일과 비슷한 객체를 갖는 본문 구조체이다. 리턴되는 객체의 구조는 다음과 같다:
표 1. imap_fetchstructure()에 의해 리턴되는 객체
type | Primary body type |
encoding | Body transfer encoding |
ifsubtype | TRUE if there is a subtype string |
subtype | MIME subtype |
ifdescription | TRUE if there is a description string |
description | Content description string |
ifid | TRUE if there is an identification string |
id | Identification string |
lines | Number of lines |
bytes | Number of bytes |
ifdisposition | TRUE if there is a disposition string |
disposition | Disposition string |
ifdparameters | TRUE if the dparameters array exists |
dparameters | Disposition parameter array |
ifparameters | TRUE if the parameters array exists |
parameters | MIME parameters array |
parts | Array of objects describing each message part |
dparameters is an array of objects where each object has an "attribute" and a "value" property.
Parameter is an array of objects where each object has an "attributte" and a "value" property.
Parts is an array of objects identical in structure to the top-level object, with the limitation that it cannot contain further 'parts' objects.