//File: index.php
$form = "";
if ($seenform != "y") :
print "$form";
else :
$headers = "From: d@yoursite.com";
while ( list($key, $val) = each ($information) ) :
if ($val == "y") :
$filename = "$key.txt";
$subject = "Requested $key information";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
mail($email, $subject, $contents, $headers) or die("Can't send email!");
fclose($fd);
endif;
endwhile;
print sizeof($information)." newsletters have been sent to $email!";
endif;
?>