Index: mod/questionnaire/locallib.php =================================================================== RCS file: /cvsroot/moodle/contrib/plugins/mod/questionnaire/locallib.php,v retrieving revision 1.49.2.61 diff -u -r1.49.2.61 locallib.php --- mod/questionnaire/locallib.php 18 Aug 2009 13:13:21 -0000 1.49.2.61 +++ mod/questionnaire/locallib.php 1 Oct 2009 16:25:46 -0000 @@ -1449,17 +1449,21 @@ // use plaintext version for altbody $altbody = "\n$body_plaintext\n"; + + $mailaddresses = preg_split('/,|;/', $email); + foreach ($mailaddresses as $email) { + $userto = new Object(); + $userto->email = $email; + $userto->mailformat = 1; + $userfrom = $CFG->noreplyaddress; + if (email_to_user($userto, $userfrom, $subject, $altbody, $body_html)) { + $return = true; + } else { + $return = false; + } + } + return $return; - $userto = new Object(); - $userto->email = $email; - $userto->mailformat = 1; - $userfrom = $CFG->noreplyaddress; - - if (email_to_user($userto, $userfrom, $subject, $altbody, $body_html)) { - return true; - } else { - return false; - } } function response_insert($sid, $section, $rid, $userid, &$formdata) {