Smiling Souls

Steeped in the delicious tea like leaves of anthroposophy for the evolving soul.

Mail_IMAP::getHeaders()

array|bool getHeaders(int &$mid, [str &$pid = "0" [, bool $rtn = FALSE [, array $args = array()]]])

Sets $header property with various header information gathered from the message. This information is stored in the $header property as a multideminsional array, base-level nesting is offset by message id, sub-level is associative via the type of header information, and a third level of nesting is present for addresses, numbered offset by the address count. See the $header property for the specific header information gathered.

If the optional $rtn argument is TRUE, the contents of the $header property are returned, $rtn is FALSE by default.

The optional $args argument accepts an associative array used to specify three optional arguments of imap_headerinfo() and one optional argument of imap_rfc822_parse_headers(). array("from_length" => 1024) sets the $from_length argument of imap_headerinfo(). array("subject_length" => 1024) sets the $subject_length argument of imap_headerinfo(). array("default_host" => "unknowndomain.com") sets the $default_host argument of both imap_headerinfo() and imap_rfc822_parse_headers().

Use the $option property or the Mail_IMAP::setOptions() method to set optional arguments for imap_fetchheader() or imap_fetchbody(), which are both called on in Mail_IMAP::getRawHeaders(), which is called on by getHeaders().

getHeaders calls on Mail_IMAP::_checkIfParsed(), Mail_IMAP::getRawHeaders() and Mail_IMAP::_parseHeaderLine() internally.

Method summary:

param int &$mid message id
param str &$pid (optional) part id
param bool $rtn (optional) See above.
param bool $rtn (optional) See above.
param array $args (optional) See above.
return Array|FALSE Various message headers.
throws ErrorStack: Invalid part id. The method was unable to find a corresponding message part from the part id passed.
access public
see imap_fetchheader()
imap_fetchbody()
imap_headerinfo()
imap_rfc822_parse_headers()
Mail_IMAP::getRawHeaders()
Mail_IMAP::_checkIfParsed()
Mail_IMAP::_parseHeaderLine()

Comments

There are no comments posted at this time.

Leave a Comment

Simple HTML is allowed: <code>, <b>, <i>, <u>, <var>, <strong>, <em>, <blockquote>, <ul>, <ol>, <li>, <p> (no attributes). All spacing and line breaks in your comment will be preserved.

* All comments are moderated and are subject to approval.
Your comment will appear once it has been approved.
Posting multiple times will not expedite the approval process.

Comments are closed at this time.

© Copyright 2014 Hot Toddy, All Rights Reserved.