I want to use html code to appear in $message when it is sent, thank you.
Here it's the php script
<?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 = "TEST";
$message = "TEST";
$headers = 'From: TEST <TEST@gmail.com>' . "
";
if ( mail($to,$subject,$message,$headers) ) {
echo "The email has been sent!";
} else {
echo "The email has failed!";
}
?>