MDL-43669 messaging Enable sending email only from no-reply address

This commit is contained in:
Michael Aherne
2014-05-19 09:24:26 +01:00
parent a929fd50f9
commit 8561492010
4 changed files with 25 additions and 0 deletions
+8
View File
@@ -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;