replaceMime() public method

Replace the MIME part of the message sent from the client. Headers from the original message are always used.
Since: 2.19.0
public replaceMime ( Horde_Mime_Part $part )
$part Horde_Mime_Part The new MIME part.
Beispiel #1
0
 /**
  * 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;
 }
Beispiel #2
0
 protected function _callPreSendHook()
 {
     $hooks = $GLOBALS['injector']->getInstance('Horde_Core_Hooks');
     $params = array('raw' => $this->_raw, 'imap_msg' => $this->imapMessage, 'parent' => $this->_parentFolder, 'reply' => $this->_reply, 'forward' => $this->_forward);
     try {
         if (!($result = $hooks->callHook('activesync_email_presend', 'horde', array($params)))) {
             throw new Horde_ActiveSync_Exception('There was an issue running the activesync_email_presend hook.');
         }
         if ($result instanceof Horde_ActiveSync_Mime) {
             $this->_raw->replaceMime($result->base);
         }
     } catch (Horde_Exception_HookNotSet $e) {
     }
 }