From 85d144cb8e26378bac0e80ae6ed85f5569e5c887 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 8 Apr 2016 09:34:08 -0700 Subject: [PATCH] Send SMTP port number in test email. --- e107_admin/mailout.php | 13 +++++++++++-- e107_admin/prefs.php | 12 ++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/e107_admin/mailout.php b/e107_admin/mailout.php index b6552b370..dbc329067 100644 --- a/e107_admin/mailout.php +++ b/e107_admin/mailout.php @@ -569,12 +569,21 @@ class mailout_main_ui extends e_admin_ui else { - $add = ($pref['mailer']) ? " (".strtoupper($pref['mailer']).")" : ' (PHP)'; + $add = ($pref['mailer']) ? " (".strtoupper($pref['mailer']).") " : ' (PHP)'; + + if($pref['mailer'] == 'smtp') + { + $add .= "Port: ".varset($pref['smtp_port'],25); + $add .= " - ".str_replace("secure=", "", $pref['smtp_options']); + } + $sendto = trim($_POST['testaddress']); + + $subjectSitename = ($_POST['testtemplate'] == 'textonly') ? SITENAME : ''; $eml = array( 'e107_header' => USERID, - 'subject' => LAN_MAILOUT_113." ".$add, + 'subject' => LAN_MAILOUT_113." ".$subjectSitename.$add, 'body' => str_replace("[br]", "\n", LAN_MAILOUT_114), 'template' => vartrue($_POST['testtemplate'],null), 'shortcodes' => $this->getExampleShortcodes(), diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index 0539f67b6..b95233407 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -240,13 +240,21 @@ function sendTest() $mailheader_e107id = USERID; $pref = e107::pref('core'); - $add = ($pref['mailer']) ? " (".strtoupper($pref['mailer']).")" : ' (PHP)'; + $add = ($pref['mailer']) ? " (".strtoupper($pref['mailer']).") " : ' (PHP)'; + + if($pref['mailer'] == 'smtp') + { + $add .= "Port: ".varset($pref['smtp_port'],25); + $add .= " - ".str_replace("secure=", "", $pref['smtp_options']); + } + + $sendto = trim($_POST['testaddress']); $eml = array(); - $eml['email_subject'] = LAN_MAILOUT_113." ".SITENAME.$add; + $eml['email_subject'] = LAN_MAILOUT_113." ".$add; $eml['email_sender_email'] = null; $eml['email_sender_name'] = null; $eml['email_replyto'] = null;