I'm retrieving all the emails from xyz database, n sending it out. But the problem is tht to whomsoever gets the email, gets the matter of all the emails sent to others.
for eg a person recieving an email will get like this:
----------------------
Dear XYZ
How are you?
Dear ZYX
How are you?
& so on till all the emails from the database
------------------------
It is not going individually
Wat cud the problem be in the below code?
Code: Select all
while( $srow = mysql_fetch_array( $sresult ) )
{
$fn = $srowї'FULLNAME'];
$id = $srowї'ID_NO'];
$Fromname = "School";
$Fromaddress = "school@desgins.com";
$body = $body.''."Dear $fn ($id)\n\n" .$comm;
if ($srowї'EMAIL'] != "")
{
$cnt = $cnt + 1;
$sendto = $srowї'EMAIL'];
mail($sendto, $subject, $body, "From: ".$Fromname." <".$Fromaddress.">");
}
}