【问题标题】:Warning: mail(): Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /home/ipx12489/public_html/警告:mail():无法在 /home/ipx12489/public_html/ 中执行邮件传递程序“/usr/sbin/sendmail -t -i”
【发布时间】:2016-01-28 13:12:24
【问题描述】:

当我尝试从 php 文件发送带有 ajax 的电子邮件时,我收到了上述警告。我正在尝试代码:

$to = "suman5571@gmail.com";
$subject = "This is subject";

$message = "<b>This is HTML message.</b>";
$message .= "<h1>This is headline.</h1>";

$header = "From:suman5571@gmail.com \r\n";
$header = "Cc:dhillon0jags@gmail.com \r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";

$retval = mail ($to,$subject,$message,$header);

if( $retval == true ) {
    echo '1';
} else {
    echo '0';
}

【问题讨论】:

  • 对不起,整个代码是:$to = "suman5571@gmail.com"; $subject = "这是主题"; $message = "这是 HTML 消息。"; $message .= "

    这是标题。

    "; $header = "来自:suman5571@gmail.com \r\n"; $header = "抄送:dhillon0jags@gmail.com \r\n"; $header .= "MIME 版本:1.0\r\n"; $header .= "内容类型:文本/html\r\n"; $retval = 邮件 ($to,$subject,$message,$header); if( $retval == true ) { echo '1'; }else { 回声'0'; }
  • 删除评论。下次编辑问题,不要对编辑发表评论。
  • 标题的from 部分被cc 覆盖

标签: php ajax email core


【解决方案1】:

你应该检查你在 php.ini 中的 sendmail_path 设置。还要检查程序是否存在并已安装。

【讨论】:

  • 当我添加此代码时,它正在工作......并且电子邮件也在发送。但是第二天我检查了它,它不起作用。
  • 如何进行上述设置请建议我。
猜你喜欢
  • 2017-06-11
  • 1970-01-01
  • 1970-01-01
  • 2012-08-24
  • 1970-01-01
  • 2016-11-12
  • 2021-08-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多