最新消息: 新版网站上线了!!!

phpcms自定义表单向导提交后发送邮箱

修改 phpcms\modules\formguide\index.php 找到
foreach ($mails as $m) {
    sendmail($m, L('tips'), $this->M['mailmessage']);
}
替换成
$f_info = $this->db->get_one(array('modelid'=>$formid, 'siteid'=>$this->siteid));
$MailSubject = '用户提交表单['.$f_info['name'].']提醒';
$Fields = getcache('formguide_field_'.$formid, 'model');
$Fields['username']['name'] = '用户名';
$Fields['datetime']['name'] = '提交时间';
$Fields['ip']['name'] = '提交IP';
unset($data['userid'], $data['datetime']);
foreach($data as $k=>$v){
    $MailBody .= $Fields[$k]['name'].'        :'.$v.'<br />';
}
foreach ($mails as $m) {
    sendmail($m, $MailSubject, $MailBody.$this->M['mailmessage']);
}

转载请注明:谷谷点程序 » phpcms自定义表单向导提交后发送邮箱