乌克兰粉嫩XXX极品HD-国产色诱视频在线播放丝袜-久久国产精品77777-软萌小仙自慰喷白浆

建站知識

Welcome to Beijing RuiHeng TianLong Technology Co., Ltd.

網(wǎng)站建設(shè)dede留言后發(fā)郵件,dede自定義表單提交發(fā)送郵件到指定郵箱,兩種方法解決方案。

時間:  來源:網(wǎng)站建設(shè)公司  作者:網(wǎng)站制作公司  點(diǎn)擊量:
網(wǎng)站建設(shè)dede留言后發(fā)郵件,dede自定義表單提交發(fā)送郵件到指定郵箱,兩種方法解決方案。
有兩種方法,我們來分別介紹一下,網(wǎng)站建設(shè)時, 用dede自定義表單和留言后,想把留言和自定義表單內(nèi)容發(fā)送到指定郵箱,
我們先來看一種簡單的方法,直接用代碼就可以了

1、 直接用代碼的方法
打開plus下面的diy.php文件:
83行:$query = "INSERT INTO `{$diy->table}` (`id`, `ifcheck` $addvar)  VALUES (NULL, 0 $addvalue); ";后面開始加入代碼:
$mailtitle = $name."提交表單通知";
$mailbody = "稱呼:{$name}\r\n郵箱:{$email}\r\n內(nèi)容:{$message}";
$headers = $cfg_adminemail;
$mailtype = 'TXT';
require_once(DEDEINC.'/mail.class.php');
$smtp = new smtp($cfg_smtp_server,$cfg_smtp_port,true,$cfg_smtp_usermail,$cfg_smtp_password);
$smtp->debug = false;
$smtp->sendmail($cfg_smtp_usermail,$cfg_webname ,$cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype);

$name $email $message 三個變量都是提交的字段,你提交的字段名稱前面加$符號就行,這個根據(jù)你的需要來改。然后保存。
網(wǎng)站后臺添加好發(fā)布郵箱的參數(shù),這個教程不懂得話搜索下怎么設(shè)置,成功的話提交表單之后就會發(fā)送郵件到你的郵箱的,親自測試過可以,其他網(wǎng)站建設(shè)的方法有點(diǎn)繁瑣,類似第二種方法,我們來看一下。


2、這種方法網(wǎng)上一搜索很多,我們沒有親自試驗(yàn)過

打開/plus/diy.php 文件

找到如下代碼:

PHP代碼
  1. require_once DEDEINC.'/diyform.cls.php';
  2. $diy = new diyform($diyid);

在下面添加發(fā)送郵件代碼,發(fā)送郵件代碼見這里(一定要先看這里) PHPMailer 詳細(xì)介紹及使用方法 發(fā)送郵件 

PHPmailer 發(fā)送郵件設(shè)置指定發(fā)件人郵箱

以下是DEDE織夢實(shí)現(xiàn)代碼,本人在dede5.7 sp1下測試成功

PHP代碼
  1. .....   
  2. require_once DEDEINC.'/diyform.cls.php';   
  3. $diy = new diyform($diyid);   
  4.   
  5.     require("class.phpmailer.php"); //下載的文件必須放在該文件所在目錄   
  6.     $mail = new PHPMailer(); //建立郵件發(fā)送類   
  7.     $address ="javlee@qq.com";   
  8.     $mail->IsSMTP(); // 使用SMTP方式發(fā)送   
  9.     $mail->Host = "smtp.163.com"; // 您的企業(yè)郵局域名   
  10.     $mail->SMTPAuth = true; // 啟用SMTP驗(yàn)證功能   
  11.     $mail->Username = "legeorwa@163.com"; // 郵局用戶名(請?zhí)顚懲暾膃mail地址)   
  12.     $mail->Password = "Arkbkwgkwg240."; // 郵局密碼   
  13.     $mail->Port=25;   
  14.     $mail->From = "legeorwa@163.com"; //郵件發(fā)送email地址    
  15.     $mail->FromName = $fullname;   
  16.     $mail->AddAddress("$address", "Tibet");//收件人地址,可以替換成任何想要接收郵件的email信箱,格式是AddAddress("收件人email","收件人姓名")   
  17.    if($action == 'post') {
      if($do == 2) {
  18.     $mail->Subject = $trip; //郵件標(biāo)題   
  19.     $mail->Body = "Interested trip: $trip<br /> Full Name: $fullname<br /> E-mail: $email<br /> Contact Number: $contact<br /> Nationality: $nationality<br /> Number of Adult travelers: $travelers<br /> Number of children under 12: $children<br /> Approximate Entry Date: $entrydate<br /> Last city before entering Tibet: $city<br /> Hotel Class: $hotelclass<br /> Transportation preference: $preference<br /> Needed flight & train tickets from us: $flight<br /> What type of experience you are looking for?<br />$looking<br /><br /> Where would you like to visit?<br />$visit<br /><br /> What other information should we know?<br />$should<br /><br /> How did you know about us?<br />$about"; //郵件內(nèi)容   
  20.     $mail->AltBody = "This is the mail sent from tibetjiontour (Tailormake a tour)"; //附加信息,可以省略   
  21.        
  22.     if(!$mail->Send())   
  23.     {   
  24.     //echo "Fail to send. <p>";   
  25.     //echo "Cause of the error: " . $mail->ErrorInfo;   
  26.     //exit;   
  27.     }   
  28.   
  29.     //echo "郵件發(fā)送成功";   
  30.    }
  31. }
  32.   
  33. /*----------------------------  
  34. function Post(){ }  
  35. ---------------------------*/  
  36.   

在網(wǎng)站建設(shè)中,留言發(fā)郵件,和自定義表單提交后發(fā)送到郵箱,的方法你學(xué)會了嗎??


There are two methods, we were introduced to it, construction sites, use dede custom forms and message after trying to leave a message, and custom form content is sent to the specified mailbox,
Let's look at a simple way, the code can be used directly


本文TAG標(biāo)簽: 北京網(wǎng)站建設(shè) 網(wǎng)站建設(shè) 網(wǎng)站制作
返回關(guān)閉本頁
上一篇:照片沖印網(wǎng)站制作,個性定制網(wǎng)站建設(shè),禮品定制網(wǎng)上沖印網(wǎng)站建設(shè)。    下一篇:北京網(wǎng)站建設(shè),dede漏洞,受攻擊,dede安全怎么做?dede掛馬彈窗數(shù)據(jù)丟失怎么解決?
推薦閱讀

Copyright © 2010-2021 北京瑞恒天龍科技有限公司  All Rights Reserved  |  北京網(wǎng)站建設(shè)知名服務(wù)商  |  北京網(wǎng)站制作 | 京ICP備11004170號-1   京公網(wǎng)安備110107000463號
地址:北京市海淀區(qū)永定路長銀大廈B座  非工作時間:15810379666  服務(wù)熱線:400-809-6709  版權(quán)所有 盜版必究!

在線咨詢
關(guān)閉
電話咨詢
網(wǎng)站制作電話
400-809-6709