PHP Email Not Working
I've recently installed my server on VPS, PHP mail is not working, I've tryed everywhere but I can't get it to work. If it is not a syntax error I would appreciate if someone could help with setting PHP mail up. Im running ubuntu 10.04
My code is:
$ToEmail = 'my@email.com';
$EmailSubject = 'Site contact form ';
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n开发者_StackOverflow中文版";
$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");
According to the log you posted:
Jun 13 11:49:42 hedgehog postfix/master[12617]: fatal: bind 0.0.0.0 port 25: Address already in use
This should give you a clue if you are unable to connect to your server.
精彩评论