From 579dcca41ea2f28b97fe7efb837c6e7fb06f56cd Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 3 Aug 2004 04:03:01 +0000 Subject: [PATCH] Email function now returns an "emailstop" error if email was blocked --- lib/moodlelib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index b73751007e..0775a70746 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1393,6 +1393,9 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml="", $a /// attachname - the name of the file (extension indicates MIME) /// usetrueaddress - determines whether $from email address should be sent out. /// Will be overruled by user profile setting for maildisplay +/// +/// Returns "true" if mail was sent OK, "emailstop" if email was blocked by user +/// and "false" if there was another sort of error. global $CFG, $_SERVER; @@ -1408,7 +1411,7 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml="", $a } if (!empty($user->emailstop)) { - return false; + return 'emailstop'; } $mail = new phpmailer; -- 2.39.5