getMessage() public method

Returns the raw message with the message headers stripped.
public getMessage ( ) : Horde_Stream
return Horde_Stream
示例#1
0
文件: Mail.php 项目: jubinpatel/horde
 /**
  * Send the raw message received from the client. E.g., NOT a SMART request.
  *
  * @throws Horde_ActiveSync_Exception
  */
 protected function _sendRaw()
 {
     $h_array = $this->_headers->toArray(array('charset' => 'UTF-8'));
     $recipients = $h_array['To'];
     if (!empty($h_array['Cc'])) {
         $recipients .= ',' . $h_array['Cc'];
     }
     if (!empty($h_array['Bcc'])) {
         $recipients .= ',' . $h_array['Bcc'];
         unset($h_array['Bcc']);
     }
     try {
         $GLOBALS['injector']->getInstance('Horde_Mail')->send($recipients, $h_array, $this->_raw->getMessage()->stream);
     } catch (Horde_Mail_Exception $e) {
         throw new Horde_ActiveSync_Exception($e->getMessage());
     }
     // Replace MIME? Don't have original body, but still need headers.
     // @TODO: Get JUST the headers?
     if ($this->_replaceMime) {
         try {
             $this->_getImapMessage();
         } catch (Horde_Exception_NotFound $e) {
             throw new Horde_ActiveSync_Exception($e->getMessage());
         }
     }
 }
示例#2
0
文件: Mail.php 项目: raz0rsdge/horde
 /**
  * Some clients (HTC One devices, for one) generate HTML signatures
  * that contain line lengths too long for servers without BINARYMIME to
  * send. If we are here, see if that's the reason by checking content
  * encoding and trying again.
  *
  * @return boolean
  */
 protected function _tryWithoutBinary($recipients, array $headers)
 {
     // All we need to do is re-assign the mime object. This will cause the
     // content transfer encoding to be re-evaulated and set to an approriate
     // value if needed.
     $mime = $this->_raw->getMimeObject();
     $this->_raw->replaceMime($mime);
     try {
         $GLOBALS['injector']->getInstance('Horde_Mail')->send($recipients, $headers, $this->_raw->getMessage()->stream);
     } catch (Exception $e) {
         return false;
     }
     return true;
 }