【发布时间】:2011-04-07 17:58:40
【问题描述】:
我有两台服务器。一个(linux)将使用下面的脚本很好地发送邮件。第二个(windows server 2008)什么都不发送。
<?php mail ( "nobody@email.com", "Contact Us Form", "This is an email from your site", "From: nobody@email.com" )
?>
【问题讨论】:
我有两台服务器。一个(linux)将使用下面的脚本很好地发送邮件。第二个(windows server 2008)什么都不发送。
<?php mail ( "nobody@email.com", "Contact Us Form", "This is an email from your site", "From: nobody@email.com" )
?>
【问题讨论】:
mail() 在 linux 和 windows 上的工作方式非常不同。
在 Windows 上,最好的办法是设置 SMTP 信息,以便 PHP 可以将邮件移交给另一台负责最终投递的服务器。
http://ca2.php.net/manual/en/mail.configuration.php#ini.smtp
已经完成(并且您的网络服务器重新启动以使更改生效)如果您仍然无法发送邮件,请检查 PHP 和指定 MTA 的日志以查看故障所在。
【讨论】:
检查您的 PHP.ini 您也可以在脚本级别使用 ini_set 函数覆盖这些(我认为)。
[mail function]
; For Win32 only.
SMTP = xxx.xxx.xxx.xxx
smtp_port = xx
【讨论】: