From 62e298ba4241d9c060f07c979f5bcba6ed88c163 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 22 Dec 2008 23:08:53 -0700 Subject: [PATCH] Add IMP_Compose::getMailerParams(). --- imp/lib/Compose.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index 09f2291dd..91ddb89b6 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -661,10 +661,22 @@ class IMP_Compose } } + $mail_driver = $this->getMailDriver(); + + return $message->send($email, $headers, $mail_driver['driver'], $mail_driver['params']); + } + + /** + * Return mail driver/params necessary to send a message. + * + * @return array 'driver' => mail dirver; 'params' => list of params. + */ + static public function getMailDriver() + { /* We don't actually want to alter the contents of the $conf['mailer'] * array, so we make a copy of the current settings. We will apply our * modifications (if any) to the copy, instead. */ - $params = $conf['mailer']['params']; + $params = $GLOBALS['conf']['mailer']['params']; /* Force the SMTP host and port value to the current SMTP server if * one has been selected for this connection. */ @@ -683,7 +695,7 @@ class IMP_Compose $params['password'] = Horde_Secret::read(IMP::getAuthKey(), $_SESSION['imp']['pass']); } - return $message->send($email, $headers, $conf['mailer']['type'], $params); + return array('driver' => $GLOBALS['conf']['mailer']['type'], 'params' => $params); } /** -- 2.11.0