function valid_email_address

Verifies the syntax of the given e-mail address.

This uses the PHP e-mail validation filter.

Parameters

$mail: A string containing an e-mail address.

Return value

TRUE if the address is in a valid format.

Related topics

4 calls to valid_email_address()
CategoryFormController::validate in drupal/core/modules/contact/lib/Drupal/contact/CategoryFormController.php
Overrides Drupal\Core\Entity\EntityFormController::validate().
EmailAction::validate in drupal/core/modules/action/lib/Drupal/action/Plugin/Action/EmailAction.php
Form validation handler.
form_validate_email in drupal/core/includes/form.inc
Form element validation handler for #type 'email'.
UpdateSettingsForm::validateForm in drupal/core/modules/update/lib/Drupal/update/UpdateSettingsForm.php
Implements \Drupal\Core\Form\FormInterface::validateForm().

File

drupal/core/includes/common.inc, line 775
Common functions that many Drupal modules will need to reference.

Code

function valid_email_address($mail) {
  return (bool) filter_var($mail, FILTER_VALIDATE_EMAIL);
}