object imap_bodystruct(integer stream, integer message,
integer section)
The imap_bodystruct function returns an object describing the
structure of a body section. The object will contain the following
properties: bytes, description, disposition, dparameters,
encoding, id, ifdescrip-tion, ifdisposition, ifdparameters,
ifid, ifparameters, ifsubtype, lines, parameters, subtype,
type. The elements such as ifsubtype that begin with if are
booleans that signal whether the similarly named elements are
present.
object imap_check(integer stream)
The imap_check function returns information about the current mailbox in the form of
an object. Table 14.3 lists the properties of the object. If the connection has timed out,
FALSE is returned.
Table 14.3. Return Elements for imap_check
Property Description
Date (^) Date of the most recent message
Driver (^) Driver being used
Mailbox (^) Name of the mailbox
Nmsgs (^) Number of messages
Recent (^) Number of recent messages
<?
//check for new messages
$mailbox = imap_open("{mail.server.com}INBOX",
"leon","secret");
// Check messages
$check = imap_check($mailbox);
print($check->Date,"
\n");
print("Connection Type: ",$check->Driver,"
\n");
print("Mbox: ",$check->Mailbox,"
\n");
print("Number Messages: ",$check->Nmsgs);
print("Recent: ",$check->Recent,"
\n");
// show headers for messages
$nMessages=imap_num_msg($mailbox);
for($index=1; $index <= $nMesssages ; $index++)