帝國CMS修改步驟:
1.文件修改e/enews/index.php 找到如下代碼
上方加入如下代碼:
view plaincopy to clipboardprint? //trylife add for feedmail elseif($enews=='AddFeedback'){ include('../class/q_functions.php'); include('../class/SendEmail.inc.php'); include('../trylife/Mail/FeedMail.php'); } //trylife add for feedmail elseif($enews=='AddFeedback'){ include('../class/q_functions.php'); include('../class/SendEmail.inc.php'); include('../trylife/Mail/FeedMail.php'); }
2.文件上傳 FeedMail.php 文件上傳到 e/trylife/Mail/
(如無此文件夾請建立)
3.FeedMail.php文件代碼示例
<?php /*********************************************************************************** 代碼示例:(假設(shè)反饋字段為以下四個字段) 標(biāo)題:title 姓名:name 電話:call 內(nèi)容:saytext *************************************************************************************/ //取得IP地址 $ip=egetip(); //需要發(fā)送的郵箱 //$email='[email protected]'; //多郵件示例 $email=array("[email protected]","[email protected]","[email protected]"); //$subject為郵件標(biāo)題 $subject='[Service.trylife.cn信息反饋]'.$_POST['title']; //$text為郵件內(nèi)容 {$_POST['title']}為反饋字段中title字段內(nèi)容 以此類推 $text=" 標(biāo)題:{RepPostVar($_POST['title'])} 姓名:{RepPostVar($_POST['name'])} 電話:{RepPostVar($_POST['call'])} <b>內(nèi)容:</b> -------------------------------------------------------------------------------------- {$_POST['saytext']} -------------------------------------------------------------------------------------- IP:$ip "; //執(zhí)行發(fā)信 $sm=EcmsToSendMail($email,$subject,$text); ?> other1.發(fā)件人修改 e/class/SendEmail.inc.php 這個是修改發(fā)件人的EMAIL是反饋者留的郵箱地址,方便回復(fù)郵件到反饋人的郵箱 //$mailer->From=$r['fromemail']; if($_POST['email']){ $mailer->From=$_POST['email']; } else{ $mailer->From=$r['fromemail']; } //$mailer->FromName=$r['emailname']; if($_POST['name']){ $mailer->FromName=$_POST['name']; } else{ $mailer->FromName=$r['emailname']; } //$mailer->From=$r['fromemail']; if($_POST['email']){ $mailer->From=$_POST['email']; } else{ $mailer->From=$r['fromemail']; } //$mailer->FromName=$r['emailname']; if($_POST['name']){ $mailer->FromName=$_POST['name']; } else{ $mailer->FromName=$r['emailname']; }
//2010-06-17 防止字符過濾不嚴(yán)被利用 需要修改上述代碼
里面$_POST['字段']這樣的改為RepPostVar($_POST['字段'])
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: 帝國CMS二次開發(fā)反饋內(nèi)容發(fā)送到郵箱