]> git.wh0rd.org Git - tt-rss.git/commitdiff
update reset user password to use ttrssMailer
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 23 Mar 2013 05:20:16 +0000 (09:20 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 23 Mar 2013 05:20:16 +0000 (09:20 +0400)
classes/pref/users.php
classes/ttrssmailer.php

index b4f043775c082d31effc3b7c49bfec34de58c9ec..51493a273a9391784c454c24f9efdd6be7386b4c 100644 (file)
@@ -295,7 +295,7 @@ class Pref_Users extends Handler_Protected {
                                        to <b>%s</b>", $login, $email);
                        }
 
-                       require_once 'lib/phpmailer/class.phpmailer.php';
+                       require_once 'classes/ttrssmailer.php';
 
                        if ($email) {
                                require_once "lib/MiniTemplator.class.php";
@@ -313,30 +313,11 @@ class Pref_Users extends Handler_Protected {
 
                                $tpl->generateOutputToString($message);
 
-                               $mail = new PHPMailer();
+                               $mail = new ttrssMailer();
 
-                               $mail->PluginDir = "lib/phpmailer/";
-                               $mail->SetLanguage("en", "lib/phpmailer/language/");
-
-                               $mail->CharSet = "UTF-8";
-
-                               $mail->From = SMTP_FROM_ADDRESS;
-                               $mail->FromName = SMTP_FROM_NAME;
-                               $mail->AddAddress($email, $login);
-
-                               if (SMTP_HOST) {
-                                       $mail->Host = SMTP_HOST;
-                                       $mail->Mailer = "smtp";
-                                       $mail->SMTPAuth = SMTP_LOGIN != '';
-                                       $mail->Username = SMTP_LOGIN;
-                                       $mail->Password = SMTP_PASSWORD;
-                               }
-
-                               $mail->IsHTML(false);
-                               $mail->Subject = __("[tt-rss] Password change notification");
-                               $mail->Body = $message;
-
-                               $rc = $mail->Send();
+                               $rc = $mail->quickMail($email, $login,
+                                       __("[tt-rss] Password change notification"),
+                                       $message, false);
 
                                if (!$rc) print_error($mail->ErrorInfo);
                        }
index 1b450c50ce93ff521de81dbcc5b25769a4063bf1..1eb9f1d3a2fa14e409db68d2b29664f030345b10 100644 (file)
@@ -22,7 +22,7 @@ class ttrssMailer extends PHPMailer {
                public $SMTPAuth=False;\r
                public $Username;\r
                public $Password;\r
-       \r
+\r
        function __construct() {\r
                $this->SetLanguage("en", "lib/phpmailer/language/");\r
                //if SMTP_HOST is specified, use SMTP to send mail directly\r
@@ -36,7 +36,7 @@ class ttrssMailer extends PHPMailer {
                }else{\r
                        $Port = "25";\r
                }\r
-               \r
+\r
                //if SMTP_LOGIN is specified, set credentials and enable auth\r
                if(SMTP_LOGIN){\r
                        $SMTPAuth = true;\r
@@ -55,9 +55,10 @@ class ttrssMailer extends PHPMailer {
                $this->addAddress($toAddress, $toName);\r
                $this->Subject = $subject;\r
                $this->Body = $body;\r
+               $this->IsHTML($altbody != '');\r
                $rc=$this->send();\r
                return $rc;\r
        }\r
 }\r
 \r
-?>
\ No newline at end of file
+?>\r