PHP Mail function not working in Windows Server

For all of the people struggling with getting PHP mail() sending to some, but not all, recipients…look no farther. Your solution has been posted here.

It appears PHP-generated emails don’t play nice on Windows mail servers. So, when your mail goes to anyone who uses a Windows mail server , the recipients won’t get it. UNLESS YOU ADD THE LINE:

<?

ini_set (“SMTP”,”mail.mydomainname.com”);
ini_set(“smtp_port”,”25″);
ini_set(“sendmail_from”, “info@mydomainname.com”);
?>

6 Comments

  1. Sagar, If you have a valid mail domain which is registered and hosted then it will work. If you are using localhost as your sending domain then it wont work unless you have a properly configured SMTP service installed in Windows.

  2. i am using this code it was working earlier but now it stopped working n mail id is still working which i using for send mail…? windows server hosting i using

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.