1、thinkphp 怎麼實現用郵件找回密碼。新手,求詳細
首先下載mail.class.php類文件,配置文件中定義下列參數:
'MAIL_ADDRESS' => '[email protected]', // 郵箱地址
'MAIL_SMTP' => 'smtp.qq.com', // 郵箱SMTP伺服器
'MAIL_LOGINNAME' => '[email protected]', // 郵箱登錄帳號
'MAIL_PASSWORD' => '123456', // 郵箱密碼
'MAIL_CHARSET' => 'UTF-8', // 編碼
'MAIL_AUTH' => true, // 郵箱認證
'MAIL_HTML' => true, // true HTML格式 false TXT格式
tp項目org中放入mail.class.php,使用時候引入 import('@.ORG.Mail');
public function index(){
import('@.ORG.Mail');
//SendMail('admin@waikucms.com','郵件標題','郵件正文','歪酷CMS管理員');
//解釋下參數: 參數1---目標郵箱, 參數2----郵件標題,參數三--郵件正文,參數四---發件人名稱;
$content=md5(time());
session($content,$content);
$content=C('localurl').'/index.php'.U('Mail/index',array('res'=>$content));
if(SendMail('[email protected]','nihao郵件標題',$content,'unphp')){
echo 'chengong';
}else{
echo 'shi';
}
$this->display();
}
另一個頁面接受參數res:
public function index(){
header("Content-type: text/html; charset=utf-8");
$res=I('res');
echo $res;
if(session($res)==$res){
echo '密碼找回成功';
session($res,null);
}else{
echo '已經過期';
}
}
2、有一款CMS的模板與織夢格式相同的,基於thinkphp的叫什麼?
名字叫歪酷CMS
3、thinkphp 怎麼實現用郵件找回密碼。新手,求詳細
首先下載mail.class.php類文件,配置文件中定義下列參數:
'MAIL_ADDRESS'
=>
'[email protected]',
//
郵箱地址
'MAIL_SMTP'
=>
'smtp.qq.com',
//
郵箱SMTP伺服器
'MAIL_LOGINNAME'
=>
'[email protected]',
//
郵箱登錄帳號
'MAIL_PASSWORD'
=>
'123456',
//
郵箱密碼
'MAIL_CHARSET'
=>
'UTF-8',
//
編碼
'MAIL_AUTH'
=>
true,
//
郵箱認證
'MAIL_HTML'
=>
true,
//
true
HTML格式
false
TXT格式
tp項目org中放入mail.class.php,使用時候引入
import('@.ORG.Mail');
public
function
index(){
import('@.ORG.Mail');
//SendMail('[email protected]','郵件標題','郵件正文','歪酷CMS管理員');
//解釋下參數:
參數1---目標郵箱,
參數2----郵件標題,參數三--郵件正文,參數四---發件人名稱;
$content=md5(time());
session($content,$content);
$content=C('localurl').'/index.php'.U('Mail/index',array('res'=>$content));
if(SendMail('[email protected]','nihao郵件標題',$content,'unphp')){
echo
'chengong';
}else{
echo
'shi';
}
$this->display();
}
另一個頁面接受參數res:
public
function
index(){
header("Content-type:
text/html;
charset=utf-8");
$res=I('res');
echo
$res;
if(session($res)==$res){
echo
'密碼找回成功';
session($res,null);
}else{
echo
'已經過期';
}
}