Skip navigation
Help

valid_email_address

6 common.inc valid_email_address($mail)
7 common.inc valid_email_address($mail)

Verify the syntax of the given e-mail address.

Empty e-mail addresses are allowed. See RFC 2822 for details.

Parameters

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

Return value

TRUE if the address is in a valid format.

Related topics

12 calls to valid_email_address()

File

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

Code

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