织梦学习网,专业提供DEDECMS模板,DEDECMS教程,网页特效素材等建站资源!
当前位置:织梦学习网 > 织梦教程 > 二次开发 >

织梦dedecms使用支付宝支付成功后发送邮件给站长的方法

整理编辑:织梦学习网 更新时间:2017-08-28 阅读:
  打开 include/payment/alipay.php 文件

  找到
$this->log_result("verify_success,订单号:".$order_sn); //将验证结果存入文件

  在此代码下面添加如下代码(部分代码需要修改)
$mailbody = '';
$mailtitle = "订单号:".$order_sn."支付成功!";
$mailbody .= "这里是提示消息";
$email='[email protected]';//改为要接收邮件的邮箱
$cfg_sendmail_bysmtp = 'Y';
$cfg_smtp_server = 'smtp.qq.com'; //qq邮件服务器地址
$cfg_smtp_port = '25'; //端口号,默认为25
$cfg_smtp_usermail = '[email protected]'; //发件邮箱地址
$cfg_smtp_user = '织梦学习'; //名称
$cfg_webname = '织梦学习'; //站名称
$cfg_smtp_password = 'password'; //发件邮箱密码
$headers = "From: ".$cfg_smtp_usermail."\r\nReply-To: ".$cfg_smtp_usermail;
if($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server))
{         
    $mailtype = 'TXT';
    require_once(dirname(__FILE__)."/../mail.class.php");
    $smtp = new smtp($cfg_smtp_server,$cfg_smtp_port,true,$cfg_smtp_usermail,$cfg_smtp_password);
    $smtp->debug = false;
    $smtp->sendmail($email,$cfg_webname,$cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype);
}
else
{
    @mail($email, $mailtitle, $mailbody, $headers);
}


转载请注明出处:http://www.dedexuexi.com/dedejiaocheng/eckf/3364.html