From 7a77706878b07287915b0fee13a4548fe914d6c8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 29 Mar 2016 10:40:48 +0000 Subject: [PATCH] make send function compatible with Horde_Mime_Mail::send() to stop PHP complaining, also updated doco a bit --- api/src/Mailer.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/api/src/Mailer.php b/api/src/Mailer.php index 38c810bdab..66a9e352f4 100644 --- a/api/src/Mailer.php +++ b/api/src/Mailer.php @@ -1,6 +1,6 @@ getHeader('Message-ID')) && class_exists('Horde_Mime_Headers_MessageId')) // since 2.5.0 { @@ -524,7 +531,7 @@ class Mailer extends Horde_Mime_Mail try { // no flowed for encrypted messages - $flowed = $this->_body && $this->_body->getType() != 'multipart/encrypted'; + if (!isset($flowed)) $flowed = $this->_body && $this->_body->getType() != 'multipart/encrypted'; // check if flowed is disabled in mail site configuration if (($config = config::read('mail')) && $config['disable_rfc3676_flowed']) @@ -560,7 +567,7 @@ class Mailer extends Horde_Mime_Mail $this->_body = $body; $flowed = false; } - parent::send($this->account->smtpTransport(), true, $flowed); // true: keep Message-ID + parent::send($transport ? $transport : $this->account->smtpTransport(), true, $flowed); // true: keep Message-ID } catch (\Exception $e) { // in case of errors/exceptions call hook again with previous returned mail_id and error-message to log