I am sending mail using php mail()
function from my dedicated server through php script. Script is sending mail to all email users except hotmail users. Here's my code for mail()
function
$hyperlink = 'http://test.guru99.com/';
$to ='user@hotmail.com';
$subject ='Test Mail';
$message = '<p>For Testing open '. $hyperlink .'</p>';
$headers = 'From: user@domain.com';
$headers .= ' Career Guru99'. "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $subject, $message, $headers);
This code is working fine for all email users (like gmail, yahoo, hosted domain)
but not for hotmail users. My script and code is correct. I think my headers are correct but I couldn't find the cause. I want to send mail with html formatted.
I checked the server logs, the error I ma getting is "Message could not be delivered. Please ensure the message is RFC 5322 compliant"
I have checked online and tried to set various headers for the email but did not work
Please give me Suggestions.