Basically I need to notify certain users of something happening in the application.
I bring the users from the database, everything works fine, but when i send the emails, only the first one in the list receives it, I tried switching the order they are brought, and still, so is not about a particular mail client.
I tried sending one by one and now sending all together and neither seems to work.
Have this ever ocurred before? I’m using some amazon server, with linux, but is a client’s client’s server so i can’t really stick my head all over the config.
$ul = $this->q2ar("SELECT * FROM usr WHERE role_id in(1,7)");
//get admins from db
$ntf = '';
foreach($ul as $usr){
$headers = 'MIME-Version: 1.0 '." \r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . " \r\n";
$headers .= 'From: Centinelas <centinelas@serviciochevrolet.com.ec>' . " \r\n";
$body = "mail content";
$ntf .= "'".$usr['email']."'".', ';
}
$ntf = substr_replace($ntf ,"",-2);
$ml = mail($ntf,'Nuevo Caso en Centinelas Chevrolet',$body,$headers,'- fcentinelas@serviciochevrolet.com.ec');
return('email where sent to :<br/>'.$ntf);
Try sending an email to one person, like yourself or the sender then using the Cc to send to the rest.