PHP mail will not be sent with Windows Server 2008

I have two servers. One (linux) will send mail using the script below. The second (Windows 2008 server) does not send anything.

<?php mail ( " nobody@email.com ", "Contact Us Form", "This is an email from your site", "From: nobody@email.com " ) ?> 
+3
source share
2 answers

mail () works great on Linux and Windows.

  • On Linux, it sends your mail to the sendmail binary, which does all the work
  • The windows actually need to act like an MTA to transfer mail to another application.

On Windows, it is best to set SMTP information so that PHP can transfer mail to another server that takes care of the final delivery.

http://ca2.php.net/manual/en/mail.configuration.php#ini.smtp

This is done (and your web server is rebooted so that the changes affect it), if you still cannot send mail, check the logs for both PHP and the specified MTA to see where things are getting corrupted.

+3
source

Check out your PHP.ini. You can also override them with the ini_set function at the script level (I think).

 [mail function] ; For Win32 only. SMTP = xxx.xxx.xxx.xxx smtp_port = xx 
+1
source

Source: https://habr.com/ru/post/1486492/


All Articles