0
我收到此错误信息SMTP服务器响应:550阿帕奇PHP的邮件服务器
警告:电子邮件()[function.mail]:SMTP服务器响应:550请 打开SMTP验证邮件客户端,或者在发送消息之前登录到 550-IMAP/POP3服务器。 (sgs5.aws.lan) 550- [212.199.198.158]:7165不允许在没有身份验证的情况下通过此服务器550进行中继。在C:\ PROGRAM 文件\ Zend的\ Apache2的\ htdocs中\ PPC-广告-SYSTEM \结果\ DebuggerFinalResultDB.php 上线32
代码工作在我的电脑,但是当我把它放到另一个PC它不..我不知道哪里是在配置上。这里的问题是什么我设置php.ini中要做到:
ini_set("SMTP","mail.me.com");
ini_set("smtp_port","25");
ini_set("auth_username","username");
ini_set("auth_password","pass");
然后我的用户此功能:
private function send_an_email($to,$file="",$message="") {
$subject = 'PCC-Advert-System';
$message = $message."<br/><br/><br/>Time Finished Scaning:<br/><br/><br/> ".date('l jS \of F Y h:i:s A')."\r\n Ratio: \r\n".$this->ratio." \r\nFile Path:<br/> <a href='http://212.199.198.158/PPC-Advert-System/FileStorage/$file'>http://212.199.198.158/PPC-Advert-System/FileStorage/$file</a><br/><br/><br/><a href='".$this->debug_file."'>$this->debug_file </a> ";//.$this->file;
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers.= 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
echo "<br/><br/><h1>Email has been sent</h1>";
}
如果你想使用自定义SMTP,你应该使用类似'PHPMailer'的东西,很难用mail()和SMTP发送邮件。 –
该解决方案的工作..在我的电脑..但在不同的电脑它没有。我想找出问题..我不想使用其他代码 –
好吧.. phpmailer ..似乎工作..谢谢 –