I have two servers. One (linux) will send mail fine using the script below. The second (windows server 2008) sends nothing.
<?php mail ( "nobody@email.com", "Contact Us Form", "This is an email from your site", "From: nobody@email.com" )
?>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
mail() works very different on linux and windows.
On windows your best bet is to set the SMTP information so PHP can hand off the mail to another server which will take care of final delivery.
https://www.php.net/manual/en/mail.configuration.php#ini.smtp
That done (and your webserver restarted to allow the change to take affect) if you’re still unable to send mail check the logs for both PHP and the specified MTA to see where things are breaking down.