You are here

function smtp_admin_settings_submit_post_system_settings in SMTP Authentication Support 7

Same name and namespace in other branches
  1. 7.2 smtp.admin.inc \smtp_admin_settings_submit_post_system_settings()

Submit handler for the administrative settings form containing all functionality to be run after system_settings_form_submit.

1 string reference to 'smtp_admin_settings_submit_post_system_settings'
smtp_admin_settings in ./smtp.admin.inc
Administrative settings.

File

./smtp.admin.inc, line 336
Administrative page code for the smtp module.

Code

function smtp_admin_settings_submit_post_system_settings($form, &$form_state) {

  // If an address was given, send a test e-mail message.
  $test_address = $form_state['storage']['smtp']['smtp_test_address'];
  if ($test_address != '') {
    $language = language_default();
    $params['subject'] = t('Drupal SMTP test e-mail');
    $params['body'] = array(
      t('If you receive this message it means your site is capable of using SMTP to send e-mail.'),
    );
    drupal_mail('smtp', 'smtp-test', $test_address, $language, $params);
    drupal_set_message(t('A test e-mail has been sent to @email. You may want to <a href="!check">check the logs</a> for any error messages.', array(
      '@email' => $test_address,
      '!check' => url('admin/reports/dblog'),
    )));
  }
}