i want to send email to multiple destinataries but in destinatary shows only the email and not the others mails
for example :
instead of:
mail('juanito@gmail.com,jua@gmail.com,juana@gmail.com', $asunto, $html,$header);
in mail box: http://prntscr.com/6g4zkz
could be in mail box: http://prntscr.com/6g4zz1
but sending the 3 emails ?
Edit:
i solved like this:
while ($resulta = $dati->fetch_array()) {
$email = $resulta['email'];
mail($email, $asunto, $html,$header);
}
the only problem is i dont know how to return true or false:
public function feed_mail($id){
$mysqli = $this->connection();
$data = $mysqli->query("SELECT * FROM feed");
$dati = $mysqli->query("SELECT * FROM feed");
$dato = $mysqli->query("SELECT * FROM blog where id='$id'");
$resultado = $dato->fetch_array();
$title = $resultado['title'];
$date = $resultado['date'];
$autor= $resultado['author'];
$body = base64_decode($resultado['body']);
$asunto = 'Ortoflex - '.$title;
while ($resultados = $data->fetch_array()) {
$html = '<div style="width:80%;padding: 100px; background: #E4EDF6;border:10px solid #000000;">';
$html .= '<h1><b>'.$title.'</b></h1>';
$html .= '<br>';
$html .= $date;
$html .= '<hr>';
$html .= '<br>';
$html .= $body;
$html .= '<hr><br>';
//while ($resultados = $data->fetch_array()) {
$html .= '<a href="'.$this->url.'unsuscribe?hash='.$resultados['hash'].'">Anular Suscripción</a>';
}
$header .="MIME-Version: 1.0\n";
$header .= "Content-type: text/html; charset=iso-8859-1\n";
$header .="From: Ortoflex.mx<feed@ortoflex.mx>\n";
$header .="Return-path: feed@ortoflex.mx\n";
$header .="X-Mailer: PHP/". phpversion()."\n";
//$header .= "Bcc: ".$item."\r\n";
$to = 'private-feed@ortoflex.mx';
while ($resulta = $dati->fetch_array()) {
$email = $resulta['email'];
mail($email, $asunto, $html,$header);
}
return true;
}