I created custom module, and the module uses the
mymodule_boot function. Inside that function I wrote
user_load_by_mail to check the user is exists or not. But it is not working and I am not able to access site. It throws http error 500.
You cannot call
user_load_by_mail function in
hook_boot because this hook is called before the theme, modules, or most include files are loaded into memory. It happens while Drupal is still in bootstrap mode.
To get this function work you need to add this code before calling