/** * Returns the entire body of the message. * * @param array $options Additional options: * - stream: (boolean) If true, return a stream. * DEFAULT: No * * @return mixed The text of the part, or a stream resource if 'stream' * is true. */ public function getBody($options = array()) { if (!$this->_indices) { return $this->_message->toString(array('headers' => true, 'stream' => !empty($options['stream']))); } $query = new Horde_Imap_Client_Fetch_Query(); $query->bodytext(array('peek' => true)); return ($res = $this->_fetchData($query)) ? $res->getBodyText(0, !empty($options['stream'])) : ''; }