测试了好几个 这个一下子就成功了,但是我的分类里有两个反馈,想发送到不同的邮箱,该如何做?
大家帮帮吧
下面是TryLife反馈发送邮箱的代码
http://www.trylife.cn/ecms-feedmail/
1.文件修改e/enews/index.php 找到如下代码
view plaincopy to clipboardprint? else { include('../class/q_functions.php'); }
else { include('../class/q_functions.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文件代码示例
view plaincopy to clipboardprint? <?php /*********************************************************************************** 代码示例:(假设反馈字段为以下四个字段) 标题:title 姓名:name 电话:call 内容:saytext *************************************************************************************/ //取得IP地址 $ip=egetip(); //需要发送的邮箱 //$email='827216443@qq.com'; //多邮件示例 $email=array("827216443@qq.com","trylife@qq.com","94592590@qq.com"); //邮件标题 邮件内容 $subject='[Service.trylife.cn信息反馈]'.$_POST['title']; $text=" <b>标题:</b>{$_POST['title']} <b>姓名:</b>{$_POST['name']} <b>电话:</b>{$_POST['call']} <b>内容:</b> -------------------------------------------------------------------------------------- {$_POST['saytext']} -------------------------------------------------------------------------------------- IP:$ip "; //执行发信 $sm=EcmsToSendMail($email,$subject,$text); ?>
other1.发件人修改 e/class/SendEmail.inc.php 这个是修改发件人的EMAIL是反馈者留的邮箱地址,方便回复邮件到反馈人的邮箱
view plaincopy to clipboardprint? //$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']; }
|