The PHP mail function can send email in two scenarios:
but. Try sending email through the unix sendmail program. In linux, the sendmail program will be executed, put all the parameters in sendmail and that’s it.
OR
b. Connect to the mail server (using the smtp protocol and host / port / username / pass from php.ini) and try sending an email.
If php cannot connect to the email server, it will warn (and you see this work in your logs). To solve the problem, install the smtp server on the local computer or use any available server. How to configure / configure smtp, you can find on php.net
Maxim Sep 19 '12 at 18:13 2012-09-19 18:13
source share