Is there anyway to use the email function within a loop so that the subject and from are placed in the headers?
Here is my query and loop that is not working.
$query = "select * from pword";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
$pwordid = $row['pwordID'];
$password = $row['pword'];
$address = $row['email'];
echo "$address sent code $password<BR>Count = $pwordid<BR><BR>";
$body = "This code $password is your pass code";
mail($address,"Survey Passcodes",$body,"From: kody@domain.com\r\n");