note 98584 modified in function.imap-fetchheader by danbrown

From: Date: Fri, 25 Jun 2010 13:34:47 +0000
Subject: note 98584 modified in function.imap-fetchheader by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-170416@lists.php.net to get a copy of this message
Interesting that imap_headerinfo() does not allow a UID for the $msg_number field like all other fetching functions seem to allow. If you want to use a UID to fetch the headers, use this two-step process: <?php /* * assumes $mbox is your stream, and $uid is set * properly. Proper error checking is up to you. */ $hText = imap_fetchbody($mbox, $uid, '0', FT_UID); $headers = imap_rfc822_parse_headers($hText); ?> The result is the same as the output of imap_headerinfo(), but you get to use the UID. --was-- Interesting that imap_headerinfo() does not allow a UID for the $msg_number field like all other fetching functions seem to allow. If you want to use a UID to fetch the headers, use this two-step process: /* * assumes $mbox is your stream, and $uid is set * properly. Proper error checking is up to you. */ $hText = imap_fetchbody($mbox, $uid, '0', FT_UID); $headers = imap_rfc822_parse_headers($hText); The result is the same as the output of imap_headerinfo(), but you get to use the UID. http://php.net/manual/en/function.imap-fetchheader.php

« previous php.notes (#170416) next »