summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-03-23 09:20:16 +0400
committerAndrew Dolgov <[email protected]>2013-03-23 09:20:16 +0400
commit68fb3c955a93cfd06690dfb9c81de2fc2ffcf9f6 (patch)
treeb23c34d7287a7668f03a8b37f1bd3b5367726442
parent6ef8ec84cb66b053edf84e8738a04089f8ca1b07 (diff)
update reset user password to use ttrssMailer
-rw-r--r--classes/pref/users.php29
-rw-r--r--classes/ttrssmailer.php7
2 files changed, 9 insertions, 27 deletions
diff --git a/classes/pref/users.php b/classes/pref/users.php
index b4f043775..51493a273 100644
--- a/classes/pref/users.php
+++ b/classes/pref/users.php
@@ -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);
}
diff --git a/classes/ttrssmailer.php b/classes/ttrssmailer.php
index 1b450c50c..1eb9f1d3a 100644
--- a/classes/ttrssmailer.php
+++ b/classes/ttrssmailer.php
@@ -22,7 +22,7 @@ class ttrssMailer extends PHPMailer {
public $SMTPAuth=False;
public $Username;
public $Password;
-
+
function __construct() {
$this->SetLanguage("en", "lib/phpmailer/language/");
//if SMTP_HOST is specified, use SMTP to send mail directly
@@ -36,7 +36,7 @@ class ttrssMailer extends PHPMailer {
}else{
$Port = "25";
}
-
+
//if SMTP_LOGIN is specified, set credentials and enable auth
if(SMTP_LOGIN){
$SMTPAuth = true;
@@ -55,9 +55,10 @@ class ttrssMailer extends PHPMailer {
$this->addAddress($toAddress, $toName);
$this->Subject = $subject;
$this->Body = $body;
+ $this->IsHTML($altbody != '');
$rc=$this->send();
return $rc;
}
}
-?> \ No newline at end of file
+?>