Codice PHP:
<?php
// read the list of emails from the file.
$email_list = file("elist.txt");
// count how many emails there are.
$total_emails = count($email_list);
// go through the list and trim off the newline character.
for ($counter=0; $counter<$total_emails; $counter++) {
$email_list[$counter] = trim($email_list[$counter]);
}
// implode the list into a single variable, put commas in, apply as $to value.
$to = implode(",",$email_list);
$subject = "My email test.";
$message = "Hello, how are you?";
$headers = "From: tuamail(a)dominio.it";
if ( mail($to,$subject,$message,$headers) ) {
echo "The email has been sent!";
} else {
echo "The email has failed!";
}
?>
Questo è il codice completo (Al massimp postiamo tutti e 3 i tentativi), se non funziona come ha detto karl (scusa se scrivo ora ma la tua risposta è apparsa ora) indica che codice hai provato..