在php.ini中找到以下部分:[mail function] ; For Win32 only. SMTP = localhost 如果你自己架有SMTP服务器,就填这个 如果你没有,就找个不需要验证的SMTP服务器,填在这里; For Win32 only. sendmail_from = [email protected] 这里填的是你的EMAIL地址.也就是发信人; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ;sendmail_path = 不用管这个就是这样了.
to:LeeMaRS(小菜虎_水壶的仇人) 我用的是linux服务器,:)
那就修改这个: ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ;sendmail_path =把这里填上你的sendmail的路径还有参数 如/xxx/sendmail -t -i
还要记得,把sendmail_path=前面的;去掉.
不需要验证的SMTP服务器 是什么?
我用的是win2000 + iis + mysql +php
就是发信时不需要验证的SMTP服务器. 你可以用Foxmail等试试.
系统:FreeBSD 3.4-RELEASE +PHP4.1.2+Apache1.3.26支持smtp //mail_test.php<?php $message="See me?" $isSend = mail("[email protected]", "Subject",$message); if ($isSend) then echo "Sended!"; else echo "Failed"; ?>
; For Win32 only.
SMTP = localhost
如果你自己架有SMTP服务器,就填这个
如果你没有,就找个不需要验证的SMTP服务器,填在这里; For Win32 only.
sendmail_from = [email protected]
这里填的是你的EMAIL地址.也就是发信人; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
不用管这个就是这样了.
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =把这里填上你的sendmail的路径还有参数
如/xxx/sendmail -t -i
是什么?
你可以用Foxmail等试试.
//mail_test.php<?php
$message="See me?"
$isSend = mail("[email protected]", "Subject",$message);
if ($isSend) then
echo "Sended!";
else
echo "Failed";
?>
用phpinfo()查看PHP配置有如下几行:
Directive Local Value Master Value
sendmail_from [email protected] [email protected]
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
SMTP localhost localhost 我的测试测试程序就是下面这个文件,
//mail_test.php<?php
$message="See me?"
$isSend = mail("[email protected]", "Subject",$message);
if ($isSend) then
echo "Sended!";
else
echo "Failed";
?>
运行后,当时没有收到,第二天收到了(时间足够长了吧!)。
怎么配置?