tippytarka
Programmer
i'm having some difficulty parsing this code, which sends an email to multiple recipients.
i keep on getting the following error message. what am i doing wrong??
line 7 is ......
cheers!
i keep on getting the following error message. what am i doing wrong??
Parse error: parse error, unexpected T_VARIABLE in /homepages/...... on line 7
line 7 is ......
$email_list;
Code:
<?
// read list of emails from file.
$email_list = file("elist.txt");
// loop through email list
for ($i = 0; $i < count($email_list); $i++) {
$email_list;
}
// 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?";
if ( mail($to,$subject,$message) ) {
echo "The email has been sent!";
} else {
echo "The email has failed!";
}
?>
cheers!