]> git.wh0rd.org - tt-rss.git/blobdiff - classes/ttrssmailer.php
unify SMTP_HOST and SMTP_PORT as SMTP_SERVER
[tt-rss.git] / classes / ttrssmailer.php
index 1eb9f1d3a2fa14e409db68d2b29664f030345b10..1f365c22ed87e7c9083c07620223e1c6bf159f6b 100644 (file)
@@ -25,17 +25,20 @@ class ttrssMailer extends PHPMailer {
 \r
        function __construct() {\r
                $this->SetLanguage("en", "lib/phpmailer/language/");\r
-               //if SMTP_HOST is specified, use SMTP to send mail directly\r
+\r
                if (SMTP_HOST) {\r
-                       $Host = SMTP_HOST;\r
+                       $pair = explode(":", SMTP_HOST, 2);\r
                        $Mailer = "smtp";\r
+\r
+                       $Host = $pair[0];\r
+                       $Port = $pair[1];\r
+\r
+                       if (!$Port) $Port = 25;\r
+               } else {\r
+                       $Host = '';\r
+                       $Port = '';\r
                }\r
-               //if SMTP_PORT is specified, assign it. Otherwise default to port 25\r
-               if(SMTP_PORT){\r
-                       $Port = SMTP_PORT;\r
-               }else{\r
-                       $Port = "25";\r
-               }\r
+\r
 \r
                //if SMTP_LOGIN is specified, set credentials and enable auth\r
                if(SMTP_LOGIN){\r