7 user.module user_load_by_mail($mail)
8 user.module user_load_by_mail($mail)

Fetch a user object by email address.


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

Return value

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

See also


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


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


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


Looking through backported code and noticed this succinct D6 equivalent:

= user_load(array('mail'=> 'dries@example.com'));

If you use this to check if a user exists, beware that an empty string will return the anonymous user.