$conf['signup']['email'],
$conf['signup']['email'],
Horde_Nls::getCharset());
- $mail->send($conf['mailer']['type'], $conf['mailer']['params']);
+ $mail->send(Horde::getMailerConfig());
}
}
* documentation.
* @link http://pear.php.net/Mail
*
- * @param string $driver The Mail driver to use.
- * @param array $params Any parameters necessary for the Mail driver.
+ * @param array $config A hash with the Mail driver to use in 'type' and
+ * any parameters necessary for the Mail driver in
+ * 'params'.
* @param boolean $resend If true, the message id and date are re-used;
* If false, they will be updated.
* @param boolean $flowed Send message in flowed text format.
*
* @throws Horde_Mime_Exception
*/
- public function send($driver = null, $params = array(), $resend = false,
- $flowed = true)
+ public function send($config, $resend = false, $flowed = true)
{
/* Add mandatory headers if missing. */
if (!$resend || !$this->_headers->getValue('Message-ID')) {
}
/* Check mailer configuration. */
- if (!empty($driver)) {
- $this->_mailer_driver = $driver;
+ if (!empty($config['type'])) {
+ $this->_mailer_driver = $config['type'];
}
- if (!empty($params)) {
- $this->_mailer_params = $params;
+ if (!empty($config['params'])) {
+ $this->_mailer_params = $config['params'];
}
/* Send message. */
$mail = new Horde_Mime_Mail();
$mail->setBody($body, 'iso-8859-1', false);
$mail->addHeaders($headers);
- $result = $mail->send($this->_options['mailer']['type'], $this->_options['mailer']['params']);
+ $result = $mail->send(array('type' => $this->_options['mailer']['type'], 'params' => $this->_options['mailer']['params']));
if (is_a($result, 'PEAR_Error')) {
print $result->getMessage() . "\n";
}