Use imap_fetchheader to get the complete RFC 822 header text for a message. The
flags argument is a bitfield that takes the following constants: FT_UID,
FT_INTERNAL and FT_PREFETCHTEXT. The FT_UID and FT_INTERNAL constants
have the same meaning as when used with the imap_body function. The
FT_PREFETCHTEXT constant causes the message body to be fetched at the same time.
<?
$mailbox=imap_open("{mail.server.com}INBOX", "leon",
"password");
print(imap_fetchheader($mailbox, 1, FT_PREFETCHTEXT));
imap_close($mailbox);
?>
object imap_fetchstructure(integer stream, integer message)
The imap_fetchstructure returns an object with information about the specified
message. Table 14.4 lists the properties of this object.
Table 14.4. imap_fetchstructure Properties
Property Datatype
type (^) Integer
encoding (^) Integer
ifsubtype (^) Boolean
subtype (^) String
ifdescription (^) Boolean
description (^) String
ifid (^) Boolean
id (^) String
lines (^) Integer
bytes (^) Integer
ifdisposition (^) Boolean
disposition (^) String
ifdparameters (^) Boolean
dparameters (^) Array of Objects
ifparameters (^) Boolean
parameters (^) Array of Objects
parts (^) Array of Objects
<?
// get structure for first message