ok i have an opt-in email form where people can subscribe to a weekly newsletter, well everything seems to work, but when i send it out it wont send to the people who subcribed, but if i use my email in there it will work see this code right here will work.......
<form action="admin_mail.php" method="POST">
<div align="left"><p><font face="Arial" color="#0000FF">Send
Mail</font><font
color="#000000" face="Arial"><br>
<small> To:</small><select name="to" $
---see the code below wont work, when i want to send to all-----
<option selected value="ALL">Send To Everyone</option>
-----but the code below will work, and send out to me-----
<option
value="brooks@paisd.net">Brooks</option>
---but this code wont work to send out to only one person of the group--------
<?
$toemails = file("email_list.txt");
sort($toemails);
for($index = 0; $index < count($toemails); $index++)
{
?>
<option value="<?$toemails[$index]; print("\">$toemails[$index]</option>");
}
?>
here is the code for admin_mail.php, this is the mail sender......
<?
$from_header = "From: brooks@paisd.net";
if($comments != "")
{
//send mail - $subject & $contents come from surfer input
mail($to, $subject, $comments, $from_header);
// redirect back to url visitor came from
header("Location: http://tuna.port-aransas.k12.tx.us/~brooks/scripts/thanks.htm$
}
else
{
print("<BODY>Error, no comments were submitted!");
print("</BODY>");
}
?>
please help, any is appreciated
-BS