diff --git a/CRM/Admin/Form/Setting/Smtp.php b/CRM/Admin/Form/Setting/Smtp.php
index 2af388a2995b..500eb282ffa1 100644
--- a/CRM/Admin/Form/Setting/Smtp.php
+++ b/CRM/Admin/Form/Setting/Smtp.php
@@ -115,10 +115,9 @@ public function postProcess() {
$to = '"' . $toDisplayName . '"' . "<$toEmail>";
$from = '"' . $domainEmailName . '" <' . $domainEmailAddress . '>';
- $testMailStatusMsg = ts('Sending test email. FROM: %1 TO: %2.
', array(
- 1 => $domainEmailAddress,
- 2 => $toEmail,
- ));
+ $testMailStatusMsg = ts('Sending test email') . ':
'
+ . ts('From: %1', array(1 => $domainEmailAddress)) . '
'
+ . ts('To: %1', array(1 => $toEmail)) . '
';
$params = array();
if ($formValues['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_SMTP) {
@@ -170,7 +169,10 @@ public function postProcess() {
$errorScope = CRM_Core_TemporaryErrorScope::ignoreException();
$result = $mailer->send($toEmail, $headers, $message);
unset($errorScope);
- if (defined('CIVICRM_MAIL_LOG')) {
+ if (defined('CIVICRM_MAIL_LOG') && defined('CIVICRM_MAIL_LOG_AND_SEND')) {
+ $testMailStatusMsg .= '
' . ts('You have defined CIVICRM_MAIL_LOG_AND_SEND - mail will be logged.') . '
';
+ }
+ if (defined('CIVICRM_MAIL_LOG') && !defined('CIVICRM_MAIL_LOG_AND_SEND')) {
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')) {
diff --git a/templates/CRM/common/civicrm.settings.php.template b/templates/CRM/common/civicrm.settings.php.template
index 5392d4157d11..ae4d6e269fd8 100644
--- a/templates/CRM/common/civicrm.settings.php.template
+++ b/templates/CRM/common/civicrm.settings.php.template
@@ -304,6 +304,13 @@ if (!defined('CIVICRM_MAIL_SMARTY')) {
// define( 'CIVICRM_MAIL_LOG', '%%templateCompileDir%%/mail.log');
// }
+/**
+ * This setting will only work if CIVICRM_MAIL_LOG is defined. Mail will be logged and then sent.
+ */
+//if (!defined('CIVICRM_MAIL_LOG_AND_SEND')) {
+// define( 'CIVICRM_MAIL_LOG_AND_SEND', 1);
+//}
+
if (!defined('CIVICRM_DOMAIN_ID')) {
define( 'CIVICRM_DOMAIN_ID', 1);