PHP Mail script not working in DB Query
Posted: Wed Apr 06, 2016 3:30 am
Apart from the lacking PDO, is there any obvious reason why this won't send an email out?
Our registration script works and sends email, but this won't. And it's the same script.
Our registration script works and sends email, but this won't. And it's the same script.
Code: Select all
$result = mysql_query ("SELECT * FROM admin WHERE id='$id'");
while ($row = mysql_fetch_object($result))
{
$to = "$row->email";
$subject = "Account Active";
$headers = "From: info@domain.co.uk";
$body = "Dear $firstname
We are pleased to announce that your account is now active.
Welcome.
To login, simple go to the website, and click the Login link at the top.
Kind regards
";
mail ($to, $subject, $body, $headers);
}