警告:mail():无法在/ home / ipx12489 / public_html /中执行邮件传递程序'/ usr / sbin / sendmail -t -i'

时间:2016-01-28 13:12:24

标签: php ajax email core

当我尝试从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';
}

1 个答案:

答案 0 :(得分:0)

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