Email function now returns an "emailstop" error if email was blocked

This commit is contained in:
moodler
2004-08-03 04:03:01 +00:00
parent 50a26903e6
commit 579dcca41e
+4 -1
View File
@@ -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;