note 27385 added to function.imap-headerinfo

From: Date: Wed, 04 Dec 2002 02:12:59 +0000
Subject: note 27385 added to function.imap-headerinfo
Groups: php.notes 
Request: Send a blank email to php-notes+get-40322@lists.php.net to get a copy of this message
I was unable to get the message subject by calling imap_headerinfo AFTER calling imap_body. I flipped them (which makes more sense anyway in our usual understanding of e-mail messages) and it worked! // so this code doesn't work: //------------------------------------------------ for ($i = 1; $i <= imap_num_msg($mbox); $i++) { $messageBody = imap_body($mbox, $i); $header = imap_headerinfo($mbox, $i, 80, 80); $subject= $header->fetchsubject; } imap_close($mbox); //------------------------------------------------ // but this code does: //------------------------------------------------ for ($i = 1; $i <= imap_num_msg($mbox); $i++) { $header = imap_headerinfo($mbox, $i, 80, 80); $subject= $header->fetchsubject; $messageBody = imap_body($mbox, $i); } imap_close($mbox); //------------------------------------------------ Hope this saves some headaches! Jamie -- http://www.php.net/manual/en/function.imap-headerinfo.php http://master.php.net/manage/user-notes.php?action=edit+27385 http://master.php.net/manage/user-notes.php?action=delete+27385 http://master.php.net/manage/user-notes.php?action=reject+27385

« previous php.notes (#40322) next »