PHP 邮件不会从 Windows Server 2008 发送 [英] PHP mail will not send from Windows Server 2008

查看:21
本文介绍了PHP 邮件不会从 Windows Server 2008 发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两台服务器.一个(linux)将使用下面的脚本发送邮件.第二个(windows server 2008)什么都不发送.

I have two servers. One (linux) will send mail fine using the script below. The second (windows server 2008) sends nothing.

<?php mail ( "nobody@email.com", "Contact Us Form", "This is an email from your site", "From: nobody@email.com" )
?>

推荐答案

mail() 在 linux 和 windows 上的工作方式大不相同.

mail() works very different on linux and windows.

  • 在 Linux 上,它通过管道将您的邮件发送到 sendmail 二进制文件,后者完成所有工作
  • 在 Windows 上,它实际上需要充当 MTA 将邮件传递给另一个应用程序.

在 Windows 上,最好的办法是设置 SMTP 信息,以便 PHP 可以将邮件移交给另一台负责最终交付的服务器.

On windows your best bet is to set the SMTP information so PHP can hand off the mail to another server which will take care of final delivery.

http://ca2.php.net/manual/en/mail.configuration.php#ini.smtp

如果您仍然无法发送邮件,请检查 PHP 和指定的 MTA 的日志以查看哪里出现问题.

That done (and your webserver restarted to allow the change to take affect) if you're still unable to send mail check the logs for both PHP and the specified MTA to see where things are breaking down.

这篇关于PHP 邮件不会从 Windows Server 2008 发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆