function user_load_by_mail

Fetches a user object by email address.

Parameters

string $mail: String with the account's e-mail address.

Return value

object|bool A fully-loaded $user object upon successful user load or FALSE if user cannot be loaded.

See also

user_load_multiple()

2 calls to user_load_by_mail()
action_send_email_action in drupal/core/modules/action/action.module
Sends an e-mail message.
_update_cron_notify in drupal/core/modules/update/update.fetch.inc
Performs any notifications that should be done once cron fetches new data.

File

drupal/core/modules/user/user.module, line 308
Enables the user registration and login system.

Code

function user_load_by_mail($mail) {
  $users = entity_load_multiple_by_properties('user', array(
    'mail' => $mail,
  ));
  return reset($users);
}