MDL-43669 messaging Enable sending email only from no-reply address
This commit is contained in:
@@ -5796,6 +5796,14 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml = '',
|
||||
$mail->Sender = $supportuser->email;
|
||||
}
|
||||
|
||||
if (!empty($CFG->emailonlyfromnoreplyaddress)) {
|
||||
$usetrueaddress = false;
|
||||
if (empty($replyto) && $from->maildisplay) {
|
||||
$replyto = $from->email;
|
||||
$replytoname = fullname($from);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_string($from)) { // So we can pass whatever we want if there is need.
|
||||
$mail->From = $CFG->noreplyaddress;
|
||||
$mail->FromName = $from;
|
||||
|
||||
Reference in New Issue
Block a user