Hi there,
I have recently been using the send_to_email command and have used this to good effect in order to send students an e-mail through php code. My questions is, if i want to CC the e-mail to a member of staffs e-mail how do i go about doing this instead of having to fire off a second e-mail to them seperately?
The code i am currently using is as follows:
require_once("lib/moodlelib.php");
$from = $DB->get_record('user', array('username'=>"username_goes_here"));
#$from = $return->email;
$user = new object();
$user->firstname = "First name";
$user->lastname = "Last name";
$user->email = "*****@****.com";
$subject = "dummy subject";
$message = "dummy message goes here";
$messagehtml = "No";
email_to_user($user, $from, $subject, $message, $messagehtml);
Ok so when i run that with the proper values submitted it works a charm and the e-mail gets sent, how do i make it send to more than one user in the same e-mail or will i need to write out two email_to_user functions with the second one going to the person who is copied in?
Many thanks,
Mark