You are here

function mail_debugger_php_form_submit in Mail Debugger 7.3

File

modules/php/includes/php.mail_debugger.inc, line 112

Code

function mail_debugger_php_form_submit($values, &$form_state) {
  if ($values['param']) {
    $param = array();
    try {
      $param = $values['param'];
    } catch (Exception $ex) {
      form_set_error(NULL, $ex
        ->getMessage());
    }
  }
  $module = $values['module'];
  $key = $values['key'];
  $to = $values['to'];
  $language = $values['language'];
  $key = $values['key'];
  $from = $values['from'];
  $send = $values['send'];
  $result = drupal_mail($module, $key, $to, $language, $param, $from, $send);
  if ($result) {
    drupal_set_message('E-mail sent! Please check your mail.');
  }
  else {
    drupal_set_message('Something went wrong. Check the error logs to get more info.', 'warning');
  }
}