Skip to content

Commit b6ea337

Browse files
michieldmarianaballa
authored andcommitted
add setting PHPMAILERSUBSCRIBEHOST to be used for subscribe page mails
1 parent 1b809f0 commit b6ea337

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

public_html/lists/admin/class.phplistmailer.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ public function __construct($messageid, $email, $inBlast = true, $exceptions = f
8080

8181
if ($GLOBALS['emailsenderplugin']) {
8282
$this->Mailer = 'plugin';
83+
} elseif (!$this->inBlast && empty($_SESSION['adminloggedin']) &&
84+
defined('PHPMAILERSUBSCRIBEHOST') &&
85+
defined('PHPMAILERSUBSCRIBEHOST') && PHPMAILERSUBSCRIBEHOST != '') {
86+
# logEvent('Sending email via PHPMAILERSUBSCRIBEHOST '.PHPMAILERSUBSCRIBEHOST);
87+
$this->Host = PHPMAILERSUBSCRIBERHOST;
88+
$this->Port = PHPMAILERSUBSCRIBERHOST;
89+
$this->Mailer = 'smtp';
8390
} elseif ($this->inBlast && defined('PHPMAILERBLASTHOST') && defined('PHPMAILERBLASTPORT') && PHPMAILERBLASTHOST != '') {
8491
$this->Host = PHPMAILERBLASTHOST;
8592
$this->Port = PHPMAILERBLASTPORT;
@@ -95,7 +102,7 @@ public function __construct($messageid, $email, $inBlast = true, $exceptions = f
95102
if (defined('PHPMAILERPORT')) {
96103
$this->Port = PHPMAILERPORT;
97104
}
98-
//logEvent('Sending email via '.PHPMAILERHOST);
105+
# logEvent('Sending email via PHPMAILERTESTHOST '.PHPMAILERTESTHOST);
99106
$this->Host = PHPMAILERTESTHOST;
100107
if (isset($GLOBALS['phpmailer_smtpuser']) && $GLOBALS['phpmailer_smtpuser'] != ''
101108
&& isset($GLOBALS['phpmailer_smtppassword']) && $GLOBALS['phpmailer_smtppassword']
@@ -111,6 +118,7 @@ public function __construct($messageid, $email, $inBlast = true, $exceptions = f
111118
}
112119
//logEvent('Sending email via '.PHPMAILERHOST);
113120
$this->Host = PHPMAILERHOST;
121+
# logEvent('Sending email via PHPMAILERHOST '.PHPMAILERHOST);
114122
if (POP_BEFORE_SMTP) {
115123
// authenticate using the smtp user and password
116124
$pop = new POP3();

public_html/lists/admin/init.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,24 @@
343343
if (!defined('PHPMAILERHOST')) {
344344
define('PHPMAILERHOST', '');
345345
}
346+
if (!defined('PHPMAILERSUBSCRIBEHOST') && defined('PHPMAILERHOST')) {
347+
define('PHPMAILERSUBSCRIBEHOST', PHPMAILERHOST);
348+
}
349+
if (!defined('PHPMAILERBLASTHOST') && defined('PHPMAILERHOST')) {
350+
define('PHPMAILERBLASTHOST', PHPMAILERHOST);
351+
}
352+
if (!defined('PHPMAILERBLASTPORT') && defined('PHPMAILERPORT')) {
353+
define('PHPMAILERBLASTPORT', PHPMAILERPORT);
354+
}
355+
if (!defined('PHPMAILERTESTHOST') && defined('PHPMAILERHOST')) {
356+
define('PHPMAILERTESTHOST', PHPMAILERHOST);
357+
}
358+
if (!defined('PHPMAILER_SECURE')) {
359+
define('PHPMAILER_SECURE', 'auto');
360+
}
361+
if (!defined('PHPMAILER_SMTP_DEBUG')) {
362+
define('PHPMAILER_SMTP_DEBUG', 0);
363+
}
346364
if (!defined('MANUALLY_PROCESS_QUEUE')) {
347365
define('MANUALLY_PROCESS_QUEUE', 1);
348366
}
@@ -599,21 +617,6 @@
599617
if (!defined('INTERFACELIB')) {
600618
define('INTERFACELIB', 1);
601619
}
602-
if (!defined('PHPMAILERBLASTHOST') && defined('PHPMAILERHOST')) {
603-
define('PHPMAILERBLASTHOST', PHPMAILERHOST);
604-
}
605-
if (!defined('PHPMAILERBLASTPORT') && defined('PHPMAILERPORT')) {
606-
define('PHPMAILERBLASTPORT', PHPMAILERPORT);
607-
}
608-
if (!defined('PHPMAILERTESTHOST') && defined('PHPMAILERHOST')) {
609-
define('PHPMAILERTESTHOST', PHPMAILERHOST);
610-
}
611-
if (!defined('PHPMAILER_SECURE')) {
612-
define('PHPMAILER_SECURE', 'auto');
613-
}
614-
if (!defined('PHPMAILER_SMTP_DEBUG')) {
615-
define('PHPMAILER_SMTP_DEBUG', 0);
616-
}
617620
if (!defined('POP_BEFORE_SMTP')) {
618621
define('POP_BEFORE_SMTP', '');
619622
}

0 commit comments

Comments
 (0)