+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2017
*/
/**
$this->addFormRule(array('CRM_Admin_Form_Setting_Smtp', 'formRule'));
parent::buildQuickForm();
$buttons = $this->getElement('buttons')->getElements();
- $buttons[] = $this->createElement('submit', $this->_testButtonName, ts('Save & Send Test Email'), array('crm-icon' => 'mail-closed'));
+ $buttons[] = $this->createElement('submit', $this->_testButtonName, ts('Save & Send Test Email'), array('crm-icon' => 'fa-envelope-o'));
$this->getElement('buttons')->setElements($buttons);
}
$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 {
$formValues['smtpPassword'] = CRM_Utils_Crypt::encrypt($formValues['smtpPassword']);
}
- CRM_Core_BAO_Setting::setItem($formValues,
- CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
- 'mailing_backend'
- );
+ Civi::settings()->set('mailing_backend', $formValues);
}
/**