You are here

function phpmailer_settings_form_validate in PHPMailer 6.2

Same name and namespace in other branches
  1. 5.2 phpmailer.admin.inc \phpmailer_settings_form_validate()
  2. 6.3 phpmailer.admin.inc \phpmailer_settings_form_validate()
  3. 7.4 phpmailer.admin.inc \phpmailer_settings_form_validate()
  4. 7.3 phpmailer.admin.inc \phpmailer_settings_form_validate()

Form validation function.

See also

phpmailer_settings_form()

File

./phpmailer.admin.inc, line 167
Administrative functions for PHPMailer integration module.

Code

function phpmailer_settings_form_validate($form, &$form_state) {
  if ($form_state['values']['smtp_on']) {
    if (intval($form_state['values']['smtp_port']) == 0) {
      form_set_error('smtp_port', t('You must enter a valid SMTP port number.'));
    }
  }
}