You are here

function htmlmail_test_form_submit in HTML Mail 5

Same name and namespace in other branches
  1. 8.2 htmlmail.admin.inc \htmlmail_test_form_submit()
  2. 6.2 htmlmail.admin.inc \htmlmail_test_form_submit()
  3. 6 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.module, line 183
Send system emails in HTML

Code

function htmlmail_test_form_submit($form_id, $form_values) {
  $defaults = array(
    'to' => $form_values['to'],
    'subject' => $form_values['subject'],
    'body' => $form_values['body'],
  );
  variable_set('htmlmail_test', $defaults);
  if (drupal_mail('htmlmail-test', $form_values['to'], $form_values['subject'], $form_values['body'], $form_values['to'])) {
    drupal_set_message('Test mail sent.');
  }
  else {
    drupal_set_message('drupal_mail failed');
  }
}