doudieyou5209 2011-06-13 16:00
浏览 18
已采纳

PHP电子邮件不起作用

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"]."
"; 
     $mailheader .= "Reply-To: ".$_POST["email"]."
"; 
     $mailheader .= "Content-type: text/html; charset=iso-8859-1
"; 
     $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条回答 默认 最新

  • dongshen9686 2011-06-13 16:45
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 r包runway详细安装教程
  • ¥15 Html中读取Json文件中数据并制作表格
  • ¥15 谁有RH342练习环境
  • ¥15 STM32F407 DMA中断问题
  • ¥15 uniapp连接阿里云无法发布消息和订阅
  • ¥25 麦当劳点餐系统代码纠错
  • ¥15 轮班监督委员会问题。
  • ¥20 关于变压器的具体案例分析
  • ¥15 生成的QRCode圖片加上下載按鈕
  • ¥15 板材切割优化算法,数学建模,python,lingo