diff options
author | Andrew Dolgov <[email protected]> | 2013-04-16 16:40:04 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-04-16 16:40:04 +0400 |
commit | b9863a153c4a9295c3ddd214c1c1d21aa4807221 (patch) | |
tree | 8e678c85303782232633a44f530246ec6938e0c3 /classes/ttrssmailer.php | |
parent | ea4e11032a649596ab10006a384189445754a226 (diff) |
unify SMTP_HOST and SMTP_PORT as SMTP_SERVER
Diffstat (limited to 'classes/ttrssmailer.php')
-rw-r--r-- | classes/ttrssmailer.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/classes/ttrssmailer.php b/classes/ttrssmailer.php index 1eb9f1d3a..1f365c22e 100644 --- a/classes/ttrssmailer.php +++ b/classes/ttrssmailer.php @@ -25,17 +25,20 @@ class ttrssMailer extends PHPMailer { function __construct() {
$this->SetLanguage("en", "lib/phpmailer/language/");
- //if SMTP_HOST is specified, use SMTP to send mail directly
+
if (SMTP_HOST) {
- $Host = SMTP_HOST;
+ $pair = explode(":", SMTP_HOST, 2);
$Mailer = "smtp";
+
+ $Host = $pair[0];
+ $Port = $pair[1];
+
+ if (!$Port) $Port = 25;
+ } else {
+ $Host = '';
+ $Port = '';
}
- //if SMTP_PORT is specified, assign it. Otherwise default to port 25
- if(SMTP_PORT){
- $Port = SMTP_PORT;
- }else{
- $Port = "25";
- }
+
//if SMTP_LOGIN is specified, set credentials and enable auth
if(SMTP_LOGIN){
|