I recently shifted my servers and found that default PHP mail function is not working which was working in the previous server. I tested it by writing simple mail function
$mailto="me@domain.com"; //Enter recipient email address here
$subject = "Test Email";
$from="you@domain.com"; //Your valid email address here
$message_body = "This is a test email from Webmaster.";
$mail = mail($mailto,$subject,$message_body,"From:".$from);
var_dump($mail);
if($mail) {
echo "Your email has been sent successfully";
} else {
echo "not sent";
}
Above code return me false value. I googled it. checked my PHP.ini. It is also set as the solution mentioned in the google links.
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from =me@example.com
; For Unix only. You may supply arguments as well
(default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "/usr/sbin/sendmail -t -i"
I don't what I am missing.