valid_email_address

Versions
4.6 – 7
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

▾ 7 functions call valid_email_address()

comment_form_validate in modules/comment/comment.module
Validate comment form submissions.
contact_category_edit_form_validate in modules/contact/contact.admin.inc
Validate the contact category edit page form submission.
contact_personal_form_validate in modules/contact/contact.pages.inc
Form validation handler for contact_personal_form().
contact_site_form_validate in modules/contact/contact.pages.inc
Form validation handler for contact_site_form().
system_send_email_action_validate in modules/system/system.module
Validate system_send_email_action form submissions.
update_settings_validate in modules/update/update.settings.inc
Validation callback for the settings form.
user_validate_mail in modules/user/user.module

Code

includes/common.inc, line 1570

<?php
function valid_email_address($mail) {
  return (bool)filter_var($mail, FILTER_VALIDATE_EMAIL);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.