diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc index 09bf33b6bfd74c539bec9bcfd26287e14694f6e2..02870e9e65a8daf91cf40e68957a3284affeeda4 100644 --- a/modules/user/user.pages.inc +++ b/modules/user/user.pages.inc @@ -76,9 +76,11 @@ function user_pass_submit($form, &$form_state) { $account = $form_state['values']['account']; // Mail one time login URL and instructions using current language. - _user_mail_notify('password_reset', $account, $language); - watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->name, '%email' => $account->mail)); - drupal_set_message(t('Further instructions have been sent to your e-mail address.')); + $mail = _user_mail_notify('password_reset', $account, $language); + if (!empty($mail)) { + watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->name, '%email' => $account->mail)); + drupal_set_message(t('Further instructions have been sent to your e-mail address.')); + } $form_state['redirect'] = 'user'; return;