【发布时间】:2012-01-03 06:15:02
【问题描述】:
这是我的代码:
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>";
}
但它一直显示预订失败。我的服务器是centos vps。
/usr/local/lib/php.ini 是这样的:
[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 =
所以我把它改成了这样:
[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"
这仍然不起作用,现在我没有想法了。每次编辑 php.ini 后我都重新启动了我的服务器
【问题讨论】:
-
sendmail 把它的错误放在
/var/log/messages那里你觉得有什么有用的吗?