imap_rfc822_parse_headers

Parse mail headers from a string (PHP 4, PHP 5)
object imap_rfc822_parse_headers ( string headers [, string defaulthost] )

This function returns an object of various header elements, similar to imap_header(), except without the flags and other elements that come from the IMAP server.