首页 > 运营 > 帮助中心 > 正文

织梦CMS使用支付宝支付成功后发邮件给站长如何实现

2020-01-27 17:31:14
字体:
来源:转载
供稿:网友

支付宝支付完成发邮件的功能,实现方法:

打开/include/payment/alipay.php

找到:

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

在其下面加入下面代码,部分代码需要修改:

  1. $mailbody = ''; 
  2. $mailtitle = "订单号:".$order_sn."支付成功!"; 
  3. $mailbody .= "这里是提示信息"; 
  4. $email='[email protected]';//改为要接收邮件的邮箱 
  5. $cfg_sendmail_bysmtp = 'Y'; 
  6. $cfg_smtp_server = 'smtp.exmail.qq.com'; //qq邮件服务器地址   
  7. $cfg_smtp_port = '25'; //端口号,默认为25
  8. $cfg_smtp_usermail = '[email protected]'; //发件邮箱地址
  9. $cfg_smtp_user = '织梦58'; //名称
  10. $cfg_webname = '织梦58'; //站名称
  11. $cfg_smtp_password = 'password'; //发件邮箱密码
  12. $headers = "From: ".$cfg_smtp_usermail."/r/nReply-To: ".$cfg_smtp_usermail; 
  13. if($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server)) 
  14. {         
  15. $mailtype = 'TXT'; 
  16. require_once(dirname(__FILE__)."/../mail.class.php"); 
  17. $smtp = new smtp($cfg_smtp_server,$cfg_smtp_port,true,$cfg_smtp_usermail,$cfg_smtp_password); 
  18. $smtp->debug = false; 
  19. $smtp->sendmail($email,$cfg_webname,$cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype); 
  20. else 
  21. @mail($email, $mailtitle, $mailbody, $headers); 
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表