dedecms如何添加产品评论发送到指定邮箱。
在根目录下plus/feedback_ajax.php的文件找到
if( !$rs ) {
echo "<font color='red'>发表评论出错了!</font>";
....
} 在这里添加else {
function htmtocode($content) {这里是替换评论内容html的<br />标签
$content = str_replace(" ", " ", $content);
$content = str_replace("<br />", "\n",$content);
return $content;
}
$msg = htmtocode($msg);
$zemail='songwebs@gmail.com';//改为要接收邮件的邮箱
$mailbody = '';
$mailtitle = "www.web-song.com网站上有新的产品评论";
$mailbody .= "留言者:$username \r\n";
$mailbody .= "标题:$arctitle \r\n";
$mailbody .= "内容:$msg \r\n";
$mailbody .= "E-mail:$zemail \r\n";
$mailbody .= "Powered by http://www.web-song.com";
$headers = "From: ".$email."\r\nReply-To: ".$email;
@mail($zemail, $mailtitle, $mailbody, $headers);
}
最后变成if( !$rs ){......}else{.......}
厦门松柏建站--企业网站建设