Hi Guys,
I'm trying to send emails to the list of users an I got an template.
Here is my msg variable
$msg="Dear {name},
Your message goes here.
{link}";
I want to loop through the user database and replace name and link
while($row=$db->fetch_array($result)){
$msg=str_replace("{name}",$row[user_name]);
$msg=str_replace("{link}","http://www.com/?code=$row[user_code]");
sendmail($row[user_email],$msg);
}
I'm getting the same user name and same link(code) for each email. My question is - foreach loop shouldn't $msg update ?