this is my code:
if (mail('email@mail.com','New booking', $_REQUEST['message'])) {
echo"<p>Thanks for your booking!</p>";
} else {
echo"<p>Booking failed, please call us to book...</p>";
}
But it keeps showing booking failed. my server is centos vps.
/usr/local/lib/php.ini was like this:
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
so i changed it to this:
[mail function]
; For Win32 only.
;SMTP = localhost
;smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = "/usr/sbin/sendmail -t -i"
this still doesn’t work and now i am out of ideas. i rebooted my server after each edit of php.ini
Not sure why but directadmin had changed permissions of exim folders which caused it to fail.