You are here

function htmlmail_test_form_submit in HTML Mail 6

Same name and namespace in other branches
  1. 8.2 htmlmail.admin.inc \htmlmail_test_form_submit()
  2. 5 htmlmail.module \htmlmail_test_form_submit()
  3. 6.2 htmlmail.admin.inc \htmlmail_test_form_submit()
  4. 7.2 htmlmail.admin.inc \htmlmail_test_form_submit()
  5. 7 htmlmail.admin.inc \htmlmail_test_form_submit()

File

./htmlmail.admin.inc, line 141
Admin forms for HTML Mail

Code

function htmlmail_test_form_submit($form, &$form_state) {

  // Save form values
  $defaults = array(
    'to' => $form_state['values']['to'],
    'subject' => $form_state['values']['subject'],
    'body' => $form_state['values']['body'],
  );
  variable_set('htmlmail_test', $defaults);

  // Send email
  $params = array(
    'subject' => $form_state['values']['subject'],
    'body' => $form_state['values']['body'],
  );
  if (drupal_mail('htmlmail', 'test', $form_state['values']['to'], language_default(), $params)) {
    drupal_set_message(t('HTML Mail test message sent.'));
  }
}