function valid_email_address

valid_email_address($mail)

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

File

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

Code

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!common.inc/function/valid_email_address/7.x