function valid_email_address

Verifies the syntax of the given e-mail address.

See RFC 5321 for details.

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()
action_send_email_action_validate in drupal/core/modules/action/action.module
Validates action_send_email_action() form submissions.
CategoryFormController::validate in drupal/core/modules/contact/lib/Drupal/contact/CategoryFormController.php
Overrides Drupal\Core\Entity\EntityFormController::validate().
form_validate_email in drupal/core/includes/form.inc
Form element validation handler for #type 'email'.
update_settings_validate in drupal/core/modules/update/update.settings.inc
Form validation handler for update_settings().

File

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

Code

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