Hi guys,
This is a new server that i am testing the mail function on so i reckon that it maybe a setting in the php.ini. I had a look at the file but couldn't see anything obvious.
I am hoping one of you will know.
The script i am trying to use.
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .="Message-ID: <". time() .rand(1,1000). "@".$_SERVER['SERVER_NAME'].">". "\r\n";
$subject1 = "test email";
$toaddress = "noreply@mydomain.com";
$bod = "blah blah blah";
$meEmail = "user@user.com";
$ok = mail($toaddress, $subject1, $bod, $headers . "From: ".$meEmail." <".$meEmail.">");
if($ok){
echo "email sent"." ok=".$ok;
}else{
echo "Error sending email";
}
When i run the script it say that the email has went through but i never receive it.
If i run a simple script like below it goes through and i get the email.
mail("email@email.com","subject matter","some message");