I got the test email script and put that in and worked perfect so I put the database mysqli coding back in and the email don't work, is just a blank white page
<?php
ini_set('display_startup_errors',1);
ini_set('display_errors',1);
error_reporting(-1);
?>
<html>
<title>Automatic Email</title>
<body>
<?php
$db = mysqli_connect("" , "", "") or die("Check connection parameters!");
// Optionally skip select_db and use: mysqli_connect(host,user,pass,dbname)
mysqli_select_db($db,"") or die(mysqli_error($db));
$query = "SELECT * FROM visitors WHERE visitor_mot = DATE_ADD(curdate(), INTERVAL 1 DAY)";
$result = mysqli_query($db, $query) or die(mysqli_error($db));
//fetch tha data from the database
while ($row = mysqli_fetch_array($result)) {
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = "noreply@irhwebsites.co.uk";
$to = "ianhaney@irhwebsites.co.uk";
$subject = "PHP Mail Test script";
$message = "This is a test to check the PHP Mail functionality";
$headers = "From:" . $from;
mail($to,$subject,$message, $headers);
echo "Test email sent";
}
//close the connection
mysqli_close($db);
?>
</body>
</html>
I was just thinking if the php script stops running before it gets to the email script part?