Well that all depends on how you are connecting to the mailbox. The easiest and most efficient way to do it is via the c-client extension..
http://www.php.net/imap
If you're using the c-client extension you can use the imap_headerinfo function to read the specifc headers of a message.
http://www.php.net/imap_headerinfo
Otherwise you're likely to be using PHP itself (as opposed to the c-client extension which is written in C) to parse the structure of a message. In which case, parsing a MIME message is a complicated undertaking not easily describable in a few forum posts. I beleive the PEAR Mail_MIME package has functionality for parsing MIME messages and headers.
Of course you are also welcome to have a look at my Mail_IMAP PEAR package, which is a solution that uses the c-client extension to access mailboxes and does all the header and message parsing for you.
http://www.smilingsouls.net/index.ph...ail_IMAP/index
HTH!
Regards,
Rich
--
[
http://www.smilingsouls.net]
[
http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail