From: Andrew Dolgov Date: Tue, 16 Apr 2013 12:50:22 +0000 (+0400) Subject: ttrssMailer: actually use OOP properly X-Git-Tag: 1.7.9~25^2~201 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4f032700dbfbbfa35798e05497c8a868eb73476f;p=tt-rss.git ttrssMailer: actually use OOP properly --- diff --git a/classes/ttrssmailer.php b/classes/ttrssmailer.php index 54d18062..fd7f969a 100644 --- a/classes/ttrssmailer.php +++ b/classes/ttrssmailer.php @@ -17,34 +17,29 @@ class ttrssMailer extends PHPMailer { public $CharSet = "UTF-8"; public $PluginDir = "lib/phpmailer/"; public $ContentType = "text/html"; //default email type is HTML - public $Host; - public $Port; - public $SMTPAuth=False; - public $Username; - public $Password; function __construct() { $this->SetLanguage("en", "lib/phpmailer/language/"); if (SMTP_SERVER) { $pair = explode(":", SMTP_SERVER, 2); - $Mailer = "smtp"; + $this->Mailer = "smtp"; - $Host = $pair[0]; - $Port = $pair[1]; + $this->Host = $pair[0]; + $this->Port = $pair[1]; if (!$Port) $Port = 25; } else { - $Host = ''; - $Port = ''; + $this->Host = ''; + $this->Port = ''; } //if SMTP_LOGIN is specified, set credentials and enable auth if(SMTP_LOGIN){ - $SMTPAuth = true; - $Username = SMTP_LOGIN; - $Password = SMTP_PASSWORD; + $this->SMTPAuth = true; + $this->Username = SMTP_LOGIN; + $this->Password = SMTP_PASSWORD; } } /* @brief a simple mail function to send email using the defaults diff --git a/plugins/mail/mail.js b/plugins/mail/mail.js index 39f753cc..6166f01c 100644 --- a/plugins/mail/mail.js +++ b/plugins/mail/mail.js @@ -26,6 +26,7 @@ function emailArticle(id) { new Ajax.Request("backend.php", { parameters: dojo.objectToQuery(this.attr('value')), onComplete: function(transport) { + console.log(transport.responseText); var reply = JSON.parse(transport.responseText);