现在已经有2天时间试图找到解决此问题的方法。
最近我的本地ISP改变了他们的安全设置,现在由于标题为“已收到:(来自apache @ localhost)”,拒绝了从PHP脚本生成的电子邮件。
搜索各种文章和论坛我已经知道网络服务器/计算机找不到自己的名字(所以它出来了 作为“localhost”)发送邮件时。我在论坛上提到了所有解决方案,但仍然无法将“localhost”部分更改为我的服务器名称。
我绝望地需要帮助,并想知道是否有人可以帮助我解决这个问题。
function MAIL_NVLP($fromname, $fromaddress, $toname, $toaddress, $subject, $message)
{
// Copyright ? 2005 ECRIA LLC, http://www.ECRIA.com
// Please use or modify for any purpose but leave this notice unchanged.
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";
$headers .= "From: \"".$fromname."\" <".$fromaddress.">\n";
return mail($toaddress, $subject, $message, $headers);
}
$message = "This is a test from the support dept";
$fromname = "myname";
$fromaddress = "myname@domain.com";
$toname = "myname";
$toaddress = "myname@domain.com";
$subject = "testing new script one";
MAIL_NVLP($fromname, $fromaddress, $toname, $toaddress, $subject, $message);
echo $subject;