I'm trying to mail a newsletter to a list of people, but I get an error every time it tries to mail. Anyone know what I'm doing wrong?
<?php
$file = fopen("upload/newletter.html", "r");
$sub = fopen("to.txt", "r");
$x = 0;
$y = 0;
while (!feof($sub))
{
$names[$x] = fgets($sub);
$x++;
$y++;
}
while (!feof($file))
$content = $content . fgets($file);
echo $content;
$x = 1;
while ($x <= $y)
{
mail($names[$x], "Branches and Roots Weekly Newsletter", "Testing");
$x++;
}
?>
Heres the error I get:
Warning: mail(): Bad parameters to mail() function, mail not sent. in (Directory) on line 19