I thought I wouldn't have a problem with this, but for some reason I am not getting any emails when I run this code - the email addresses in my table go to me. The code is:
//Send an email for each record in the table
$sql = "select * from tracking";
$result = mysql_query($sql, $link) or die(mysql_error());
if ($myrow = mysql_fetch_array($result)) {
do {
echo "<br>in loop<br>";
$firstname = $myrow["firstname"];
$lastname = $myrow["lastname"];
$zipcode = $myrow["zip_code"];
$ordernumber = $myrow["order_number"];
$number = $myrow["number"];
$carrier = $myrow["carrier"];
$dateshipped = $myrow["date_shipped"];
$memo = $myrow["memo"];
$email = $myrow["email"];
$subject = "Your package has shipped!";
$emailbody = "Tracking: " . $firstname . "\n";
$emailbody .= "Tracking\n";
$emailbody .= "Tracking\n";
$from = "jim@jimday.net";
mail($email, $subject, $emailbody, $from);
} while ($myrow = mysql_fetch_array($result));
}
Am I missing something? Thanks for your help.