PHP电子邮件不起作用

时间:2011-06-13 16:00:14

标签: email ubuntu-10.04 php

我最近在VPS上安装了我的服务器,PHP邮件无法正常工作,我已经到处尝试但我无法让它工作。如果它不是语法错误,我将不胜感激,如果有人可以帮助设置PHP邮件。我正在运行ubuntu 10.04

我的代码是:

     $ToEmail = 'my@email.com'; 

     $EmailSubject = 'Site contact form '; 
     $mailheader = "From: ".$_POST["email"]."\r\n"; 
     $mailheader .= "Reply-To: ".$_POST["email"]."\r\n"; 
     $mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
     $MESSAGE_BODY = "Name: ".$_POST["name"]."<br>"; 
     $MESSAGE_BODY .= "Email: ".$_POST["email"]."<br>"; 
     $MESSAGE_BODY .= "Message: ".nl2br($_POST["message"])."<br>"; 
     $MESSAGE_BODY .= "IP: ".$_SERVER['REMOTE_ADDR']";
     mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); 

1 个答案:

答案 0 :(得分:2)

根据您发布的日志:

Jun 13 11:49:42 hedgehog postfix/master[12617]: fatal: bind 0.0.0.0 port 25: Address already in use

如果您无法连接到服务器,这应该可以为您提供线索。