summaryrefslogtreecommitdiff
path: root/classes/ttrssmailer.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/ttrssmailer.php')
-rw-r--r--classes/ttrssmailer.php34
1 files changed, 16 insertions, 18 deletions
diff --git a/classes/ttrssmailer.php b/classes/ttrssmailer.php
index 1eb9f1d3a..1e8d07723 100644
--- a/classes/ttrssmailer.php
+++ b/classes/ttrssmailer.php
@@ -17,31 +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_HOST is specified, use SMTP to send mail directly
- if (SMTP_HOST) {
- $Host = SMTP_HOST;
- $Mailer = "smtp";
- }
- //if SMTP_PORT is specified, assign it. Otherwise default to port 25
- if(SMTP_PORT){
- $Port = SMTP_PORT;
- }else{
- $Port = "25";
+
+ if (SMTP_SERVER) {
+ $pair = explode(":", SMTP_SERVER, 2);
+ $this->Mailer = "smtp";
+
+ $this->Host = $pair[0];
+ $this->Port = $pair[1];
+
+ if (!$this->Port) $this->Port = 25;
+ } else {
+ $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