From: Joe Hunt Date: Tue, 8 Jan 2019 22:41:40 +0000 (+0100) Subject: Password reset mail could take several hours. After fix only a couple of seconds... X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=a31195793c023906ab5da62f06ab84aefed445c3 Password reset mail could take several hours. After fix only a couple of seconds. Using From: email in header. --- diff --git a/includes/current_user.inc b/includes/current_user.inc index edfae0a9..c3d162e0 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -158,8 +158,14 @@ class current_user $hash = md5($password); update_user_password($user['id'], $user['user_id'], $hash); - - mail($email, _("New password for")." ".$SysPrefs->app_title, $password); + + $sender = get_company_pref('email'); + if (empty($sender)) + $header = ""; + else + $header = "From: $sender"; + + mail($email, _("New password for")." ".$SysPrefs->app_title, $password, $header); return true; }