You are here

function phpmailer_settings_form_validate in PHPMailer 5.2

Same name and namespace in other branches
  1. 6.3 phpmailer.admin.inc \phpmailer_settings_form_validate()
  2. 6.2 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 149
Administrative functions for PHPMailer integration module.

Code

function phpmailer_settings_form_validate($form_id, $form_values, $form) {
  if ($form_values['smtp_on']) {
    if (intval($form_values['smtp_port']) == 0) {
      form_set_error('smtp_port', t('You need to enter a valid SMTP port number.'));
    }
  }
}