0

I have made a password recovery option in my website using php mail function. It works with gmail and yahoo but when the email is hotmail it does not works, I tried many time. When I tried with my companies email (outlook) nothing happens. It only works with gmail and yahoo. What can be wrong with it. the code I am using is her below:

$email= "customer_email_address";

$head = "From: \"Pizza Hut Pakistan\" <no-reply@pizzahut.com.pk>\n";
        $head .= "X-Mailer: RegFormPHP\n";
        $head .= "Priority: urgent\n";
        $head .= "Importance: High\n";
        $head .= "Content-Language: en-us\n";
        $head .= "Reply-To: <no-reply@pizzahut.com.pk>\n";
        $head .= "Organization: \"Pizza Hut Pakistan\"\n";
        $head .= "Content-Type: text/html\r\n";

        $msg = 'Click the link below to proceed <br><br>';

$msg .= 'http://'.$_SERVER['HTTP_HOST'].'/root_folder/forgotlink.php?id='.$unique_code_of_user;
mail($email, "website account password recovery", $msg, $head);

every thing is cool with gmail and yahoo. but..... nothing works with others....

Thanks

Saleem Jafar
  • 123
  • 1
  • 3
  • 13
  • What do you mean by it doesn't work? What type of error you receive? Have you checked the PHP error log? – Erick Jan 26 '16 at 10:45
  • This post may answer your question: http://stackoverflow.com/questions/13324649/mail-not-being-received-by-hotmail-com – Andreas Schrammel Jan 26 '16 at 10:48
  • Nothing happens when i click password recovery button! the success message display but there is no email in my hotmail inbox, junk/spam folder. Don't know what is wrong with it. When I am trying with gmail, or yahoo then it is fine. – Saleem Jafar Jan 26 '16 at 11:40

1 Answers1

0

Hotmail is probably rejecting your emails thinking it's spam.

Hotmail is known to be a PITA when it comes to emails... You can check if you have correct DKIM and SPF parameters, see if your server isn't blacklisted, or better yet, use a mailing provider like MailChimp, SendGrid or similar to be sure your emails are sended in best conditions.

You can try class.phpmailer.php. It works for Yahoo, Hotmail, GMail,

Jsparo30
  • 405
  • 4
  • 10
  • 30