funzione mail:
Codice PHP:
$header = "From: ". $mittente . " <" . $emailmittente . ">\r\n";
foreach ($ELENCOMAIL as $to) {
mail($to, $subject, $testo, $header);
};
devi definire anche $subject (l'oggetto del messaggio) e separare correttamente le mail dentro la variabile $to
potrebbe essere meglio - se non ti crea problemi - fare un unico invio mettendo i destinata
ri in Cc:
Codice PHP:
$header = "From: ". $mittente . " <" . $emailmittente . ">\r\n";
foreach ($ELENCOMAIL as $to) {
$cc .= $to.'; ';
};
$header .= "Cc: ".$cc;
$to = $mittente; // invia a te stesso per riempire il campo TO e avere un riscontro
mail($to, $subject, $testo, $header);
supponendo che $ELENCOMAIL sia un array popolato con la lista delle mail