★ wanayoo — archive 1999 http://www.php.net/manual/function.imap-fetchstructure.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to IMAP
Quick Reference
German version of this pageJapanese version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
IMAP
* imap_append
* imap_base64
* imap_body
* imap_check
* imap_close
* imap_createmailbox
* imap_delete
* imap_deletemailbox
* imap_expunge
* imap_fetchbody
* imap_fetchstructure
* imap_header
* imap_rfc822_parse_headers
* imap_headers
* imap_listmailbox
* imap_getmailboxes
* imap_listsubscribed
* imap_getsubscribed
* imap_mail_copy
* imap_mail_move
* imap_num_msg
* imap_num_recent
* imap_open
* imap_ping
* imap_renamemailbox
* imap_reopen
* imap_subscribe
* imap_undelete
* imap_unsubscribe
* imap_qprint
* imap_8bit
* imap_binary
* imap_scanmailbox
* imap_mailboxmsginfo
* imap_rfc822_write_address
* imap_rfc822_parse_adrlist
* imap_setflag_full
* imap_clearflag_full
* imap_sort
* imap_fetchheader
* imap_uid
* imap_msgno
* imap_search
* imap_last_error
* imap_errors
* imap_alerts
* imap_status
* imap_utf7_decode
* imap_utf7_encode
* imap_utf8
* imap_fetch_overview
* imap_mime_header_decode
* imap_mail_compose
* imap_mail
Manual: imap_fetchstructure
View the source code for this pageSearch the site



Previous page
 imap_fetchbody
 Updated
Sat, 12 Aug 2000
imap_header 
Next page


imap_fetchstructure

(PHP3 , PHP4 )

imap_fetchstructure --  Read the structure of a particular message

Description

object imap_fetchstructure (int imap_stream, int msg_number [, int flags])

This function fetches all the structured information for a given message. The optional flags parameter only has a single option, FT_UID, which tells the function to treat the msg_number argument as a UID. The returned object includes the envelope, internal date, size, flags and body structure along with a similar object for each mime attachement. The structure of the returned objects is as follows:

Table 1. Returned Objects for imap_fetchstructure()

typePrimary body type
encodingBody transfer encoding
ifsubtypeTrue if there is a subtype string
subtypeMIME subtype
ifdescriptionTrue if there is a description string
descriptionContent description string
ifidTrue if there is an identification string
idIdentification string
linesNumber of lines
bytesNumber of bytes
ifdispositionTrue if there is a disposition string
dispositionDisposition string
ifdparametersTrue if the dparameters array exists
dparametersDisposition parameter array
ifparametersTrue if the parameters array exists
parametersMIME parameters array
partsArray of objects describing each message part

  1. dparameters is an array of objects where each object has an "attribute" and a "value" property.

  2. Parameter is an array of objects where each object has an "attributte" and a "value" property.

  3. Parts is an array of objects identical in structure to the top-level object, with the limitation that it cannot contain further 'parts' objects.

Table 2. Primary body type

0text
1multipart
2message
3application
4audio
5image
6video
7other

Table 3. Transfer encodings

07BIT
18BIT
2BINARY
3BASE64
4QUOTED-PRINTABLE
5OTHER


User Contributed Notes: imap_fetchstructure


boy_hong@hotmail.com
15-Dec-1999 05:14
How about those objects of dparameters, parameters and parts? I can't find their detail description from imap.
Could anyone descripe it for us?



hholzgra@media-engineering.de
15-Dec-1999 01:59
the parts objects are identical in
structure to those returned by imap_fetchstructure, describing one subfolder each

parameters and dparameters are MIME-specific, theese contain the
extra parameters provided in the Content-Type and Content-Disposion Header lines such as Charset or Filename



boy_hong@hotmail.com
29-Dec-1999 11:29
I tried to get ifid and id from parts. When I got ifid=1, but no id was retrieved. Any one know how to get content-id?


matt@bonneau.net
31-Dec-1999 02:53
The documentation appears to be incorrect in stating that objects in the parts array cannot have another parts array in them. I have found the parts can be recursive.


justinc@andrew.cmu.edu
11-Jan-2000 07:49
haven't read any rfc's on it, but Pine is showing a message with an attachment with type = 9 to be type BINARY...


matt@bonneau.net
18-Jan-2000 10:22
Function to figure out this stuff:
http://www.bitsense.net/PHPNotes/IMAP/imap_fetchstructure.asp



matt@bonneau.net
18-Jan-2000 10:30
List of MIME types is at
http://www.isi.edu/in-notes/iana/assignments/media-types/media-types



vksgeneric@hotmail.com
02-Feb-2000 05:22
It looks like some clients (e.g. outlook) can attach a file that has two mime-types associated with it, like:
<PRE>Content-Type: model/vrml,x-world/x-vrml
</PRE>
This bombs the parsing procedure somewhere in c-client, I guess, and as a result ifparameters is set to false for the respective part, and you can not retrieve filename, mimetype, or any other parameters. I do not expect this to get fixed any time soon, just another bug...:(



 About Notes


Previous page
 imap_fetchbody
 Updated
Sat, 12 Aug 2000
imap_header 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.