Use hash to configure Horde_Mime_Mail ctor.
authorJan Schneider <jan@horde.org>
Sun, 6 Sep 2009 16:05:27 +0000 (18:05 +0200)
committerJan Schneider <jan@horde.org>
Sun, 6 Sep 2009 16:05:27 +0000 (18:05 +0200)
ansel/img/ecard.php
ansel/lib/Report/mail.php
folks/lib/Folks.php
folks/lib/Notification/mail.php
kronolith/lib/Kronolith.php
kronolith/scripts/agenda.php
news/mail.php

index 9cbc587..80714a5 100644 (file)
@@ -78,7 +78,7 @@ case 'send':
     $alternative->addPart($related);
 
     /* Add them to the mail message */
-    $alt = new Horde_Mime_Mail(_("Ecard - ") . Horde_Util::getFormData('image_desc'), null, $to, $from, $charset);
+    $alt = new Horde_Mime_Mail(array('subject' => _("Ecard - ") . Horde_Util::getFormData('image_desc'), 'to' => $to, 'from' => $from, 'charset' => $charset));
     $alt->setBasePart($alternative);
 
     /* Send. */
index 7b1b360..853a916 100644 (file)
@@ -29,9 +29,10 @@ class Ansel_Report_mail extends Ansel_Report {
          * Needed for the Horde 4 mime library - use autoload everywhere we can
          * when this is *really* refactored for horde 4
          */
-        $mail = new Horde_Mime_Mail($this->getTitle(),
-                                    $this->getMessage($message), $to,
-                                    $this->getUserEmail());
+        $mail = new Horde_Mime_Mail(array('subject' => $this->getTitle(),
+                                          'body' => $this->getMessage($message),
+                                          'to' => $to,
+                                          'from' => $this->getUserEmail()));
 
         //FIXME: This address should be configurable
         $mail->addHeader('Sender',
index 3389575..294dab5 100644 (file)
@@ -235,7 +235,7 @@ class Folks {
      */
     static public function sendMail($to, $subject, $body, $attaches = array())
     {
-        $mail = new Horde_Mime_Mail($subject, $body, $to, $GLOBALS['conf']['support'], Horde_Nls::getCharset());
+        $mail = new Horde_Mime_Mail(array('subject' => $subject, 'body' => $body, 'to' => $to, 'from' => $GLOBALS['conf']['support'], 'charset' => Horde_Nls::getCharset()));
 
         $mail->addHeader('User-Agent', 'Folks ' . $GLOBALS['registry']->getVersion());
         $mail->addHeader('X-Originating-IP', $_SERVER['REMOTE_ADDR']);
index 20b9f7f..c1f0c02 100644 (file)
@@ -56,9 +56,10 @@ class Folks_Notification_mail extends Folks_Notification {
 
         list($mail_driver, $mail_params) = Horde::getMailerConfig();
 
-        $mail = new Horde_Mime_Mail($subject, $body, null,
-                                    $this->_params['from_addr'],
-                                    Horde_Nls::getCharset());
+        $mail = new Horde_Mime_Mail(array('subject' => $subject,
+                                          'body' => $body,
+                                          'from' => $this->_params['from_addr'],
+                                          'charset' => Horde_Nls::getCharset()));
 
         $mail->addHeader('User-Agent', 'Folks ' . $GLOBALS['registry']->getVersion());
         $mail->addHeader('X-Originating-IP', $_SERVER['REMOTE_ADDR']);
index 39bb89d..063af75 100644 (file)
@@ -1357,7 +1357,11 @@ class Kronolith
             $ics->setCharset(Horde_Nls::getCharset());
 
             $recipient = empty($status['name']) ? $email : Horde_Mime_Address::trimAddress($status['name'] . ' <' . $email . '>');
-            $mail = new Horde_Mime_Mail($subject, $message, $recipient, $from, Horde_Nls::getCharset());
+            $mail = new Horde_Mime_Mail(array('subject' => $subject,
+                                              'body' => $message,
+                                              'to' => $recipient,
+                                              'from' => $from,
+                                              'charset' => Horde_Nls::getCharset()));
             $mail->addHeader('User-Agent', 'Kronolith ' . $GLOBALS['registry']->getVersion());
             $mail->addMimePart($ics);
 
@@ -1483,11 +1487,10 @@ class Kronolith
                                   $event->start->strftime($tf ? '%R' : '%I:%M%p'))
                         . "\n\n" . $event->getDescription();
 
-                    $mime_mail = new Horde_Mime_Mail($subject . ' ' . $event->title,
-                                                     null,
-                                                     implode(',', $df_recipients),
-                                                     $from,
-                                                     Horde_Nls::getCharset());
+                    $mime_mail = new Horde_Mime_Mail(array('subject' => $subject . ' ' . $event->title,
+                                                           'to' => implode(',', $df_recipients),
+                                                           'from' => $from,
+                                                           'charset' => Horde_Nls::getCharset()));
                     $mail->addHeader('User-Agent', 'Kronolith ' . $GLOBALS['registry']->getVersion());
                     $mime_mail->setBody($message, Horde_Nls::getCharset(), true);
                     Horde::logMessage(sprintf('Sending event notifications for %s to %s', $event->title, implode(', ', $df_recipients)), __FILE__, __LINE__, PEAR_LOG_DEBUG);
index ff0da1a..8f3a669 100755 (executable)
@@ -142,11 +142,10 @@ function send_agendas()
         $twentyFour = $prefs->getValue('twentyFour');
         $dateFormat = $prefs->getValue('date_format');
         Horde_Nls::setLanguageEnvironment($lang);
-        $mime_mail = new Horde_Mime_Mail(sprintf(_("Your daily agenda for %s"), strftime($dateFormat, $runtime)),
-                                         null,
-                                         $email,
-                                         $GLOBALS['conf']['reminder']['from_addr'],
-                                         Horde_Nls::getCharset());
+        $mime_mail = new Horde_Mime_Mail(array('subject' => sprintf(_("Your daily agenda for %s"), strftime($dateFormat, $runtime)),
+                                               'to' => $email,
+                                               'from' => $GLOBALS['conf']['reminder']['from_addr'],
+                                               'charset' => Horde_Nls::getCharset()));
         $mime_mail->addHeader('User-Agent', 'Kronolith ' . $registry->getVersion());
 
         $pad = max(Horde_String::length(_("All day")) + 2, $twentyFour ? 6 : 8);
index 8703862..a51a281 100644 (file)
@@ -53,7 +53,7 @@ $body = sprintf(_("%s would you like to invite you to read the news\n Title: %s\
                 $row['publish'],
                 News::getUrlFor('news', $id, true, -1));
 
-$mail = new Horde_Mime_Mail($row['title'], $body, $to, $from, Horde_Nls::getCharset());
+$mail = new Horde_Mime_Mail(array('subject' => $row['title'], 'body' => $body, 'to' => $to, 'from' => $from, 'charset' => Horde_Nls::getCharset()));
 $result = $mail->send($conf['mailer']['type'], $conf['mailer']['params']);
 if ($result instanceof PEAR_Error) {
     $notification->push($result);