- // send a copy of password change notification to the admin
- // but check to see if it's the admin whose password we're changing, and skip this
- if ( $user->user_email != get_option('admin_email') ) {
- $message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n";
- wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), get_option('blogname')), $message);
- }
+ $title = apply_filters('password_reset_title', $title);
+ $message = apply_filters('password_reset_message', $message, $new_pass);
+
+ if ( $message && !wp_mail($user->user_email, $title, $message) )
+ die('<p>' . __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') . '</p>');
+
+ wp_password_change_notification($user);