1 user.module user_load_by_mail($mail)

Fetch a user object by email address.

Parameters

$mail: String with the account's email address.

Return value

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

See also

user_load_multiple()

File

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

Code

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