You are here

function mail_debugger_basic_form_validate in Mail Debugger 7.3

Validate entered values

Parameters

array $values:

array $elements:

array $form_state:

1 string reference to 'mail_debugger_basic_form_validate'
mail_debugger_common_mail_debugger_info in modules/common/mail_debugger_common.module
Implement hook_mail_debugger_info();

File

modules/common/includes/basic.mail_debugger.inc, line 39

Code

function mail_debugger_basic_form_validate($values, $elements, &$form_state) {
  if (!valid_email_address($values['to'])) {
    form_set_error($elements['to'], t('Enter a valid e-mail address'));
  }
  if (empty($values['subject'])) {
    form_set_error($elements['subject'], t('Enter a subject'));
  }
  if (empty($values['body'])) {
    form_set_error($elements['body'], t('Enter content for the mail'));
  }
}