From df15173899af0f67d7beff66dee97620961f8d33 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Thu, 17 Aug 2017 19:37:42 +0100 Subject: [PATCH] Add warning when CIVICRM_MAIL_LOG is set and you are testing outbound mail settings --- CRM/Admin/Form/Setting/Smtp.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Admin/Form/Setting/Smtp.php b/CRM/Admin/Form/Setting/Smtp.php index 0be1226d70..84c8728287 100644 --- a/CRM/Admin/Form/Setting/Smtp.php +++ b/CRM/Admin/Form/Setting/Smtp.php @@ -166,7 +166,10 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting { $errorScope = CRM_Core_TemporaryErrorScope::ignoreException(); $result = $mailer->send($toEmail, $headers, $message); unset($errorScope); - if (!is_a($result, 'PEAR_Error')) { + if (defined('CIVICRM_MAIL_LOG')) { + CRM_Core_Session::setStatus($testMailStatusMsg . ts('You have defined CIVICRM_MAIL_LOG - no mail will be sent. Your %1 settings have not been tested.', array(1 => strtoupper($mailerName))), ts("Mail not sent"), "warning"); + } + elseif (!is_a($result, 'PEAR_Error')) { CRM_Core_Session::setStatus($testMailStatusMsg . ts('Your %1 settings are correct. A test email has been sent to your email address.', array(1 => strtoupper($mailerName))), ts("Mail Sent"), "success"); } else { -- 2.25.1