Home > CMS Tutorial > Empire CMS > body text

Imperial CMS implements the method of sending feedback information content to the mailbox

silencement
Release: 2019-11-27 13:20:42
forward
3665 people have browsed it

Imperial CMS implements the method of sending feedback information content to the mailbox

The example of this article describes the method of sending feedback information to the mailbox by Imperial CMS. Share it with everyone for your reference. The specific implementation method is as follows:

Empire CMS modification steps:

1. File modification e/enews/index.php Find the following code, add the following code above:

The code is as follows:

//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');
}
Copy after login

2. File upload FeedMail.php file is uploaded to e/trylife/Mail/. If there is no such folder, please create it.

3. FeedMail.php file code example :

The code is as follows:

<?php
/***********************************************************************************
代码示例:(假设反馈字段为以下四个字段)
标题:title
姓名:name
电话:call
内容:saytext
*************************************************************************************/
//取得IP地址
$ip=egetip();
//需要发送的邮箱
//$email=&#39;123456789@qq.com&#39;;
//多邮件示例
$email=array("123456789@qq.com","trylife@qq.com","987654321@qq.com");
//$subject为邮件标题
$subject=&#39;[Service.trylife.cn信息反馈]&#39;.$_POST[&#39;title&#39;];
//$text为邮件内容 {$_POST[&#39;title&#39;]}为反馈字段中title字段内容 以此类推
$text="
标题:{RepPostVar($_POST[&#39;title&#39;])}
姓名:{RepPostVar($_POST[&#39;name&#39;])}
电话:{RepPostVar($_POST[&#39;call&#39;])}
内容:
{$_POST[&#39;saytext&#39;]}
IP:$ip";
//执行发信
$sm=EcmsToSendMail($email,$subject,$text);
?>
Copy after login

Recommended to study "Empirecms Tutorial"

other1. The sender modifies e/ class/SendEmail.inc.php

This is to modify the sender's EMAIL to the email address left by the feedback person, so that it is convenient to reply to the email address of the feedback person.

The code is as follows:

//$mailer->From=$r[&#39;fromemail&#39;];
if($_POST[&#39;email&#39;]){
$mailer->From=$_POST[&#39;email&#39;];
}
else{
$mailer->From=$r[&#39;fromemail&#39;];
}
//$mailer->FromName=$r[&#39;emailname&#39;];
if($_POST[&#39;name&#39;]){
$mailer->FromName=$_POST[&#39;name&#39;];
}
else{
$mailer->FromName=$r[&#39;emailname&#39;];
}
//$mailer->From=$r[&#39;fromemail&#39;];
if($_POST[&#39;email&#39;]){
$mailer->From=$_POST[&#39;email&#39;];
}
else{
$mailer->From=$r[&#39;fromemail&#39;];
}
//$mailer->FromName=$r[&#39;emailname&#39;];
if($_POST[&#39;name&#39;]){
$mailer->FromName=$_POST[&#39;name&#39;];
}
else{
$mailer->FromName=$r[&#39;emailname&#39;];
}
//2010-06-17 防止字符过滤不严被利用 需要修改上述代码里面
Copy after login

The code is as follows:

$_POST[&#39;字段&#39;]
这样的改为
复制代码
代码如下:
RepPostVar($_POST[&#39;字段&#39;])
Copy after login

I hope this article will be helpful to everyone’s Imperial CMS website building.

The above is the detailed content of Imperial CMS implements the method of sending feedback information content to the mailbox. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:www.word666.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!