From fe0b9bce67f5b5f184d1e556b105b08577c0726a Mon Sep 17 00:00:00 2001 From: pengda <10266652509@qq.com> Date: Thu, 5 Sep 2024 15:36:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=AE=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/define.php | 11 +++++++++-- model/mBase.php | 10 +++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/config/define.php b/config/define.php index 7f04b3c..3c3cdd1 100644 --- a/config/define.php +++ b/config/define.php @@ -27,8 +27,15 @@ define('CONTACT_US_IMG_URL', TCM_DOMAIN.'/images/contact_us.png'); - $GLOBALS['notice_qqmail_list'] = array( - 'wangpd5@163.com' => 'GTKEOWXEGEUOERNR', + $GLOBALS['notice_mail_list'] = array( + 'wangpd5@163.com' => array( + 'host' => 'smtp.163.com', + 'password' => 'GTKEOWXEGEUOERNR' + ), + '1026652509@qq.com' => array( + 'host' => 'smtp.qq.com', + 'password' => 'ausuogizwarnbfej' + ), ); define('RQ_USER_CASE_DATA', 'rq_user_case_data_%s_%d'); define('RQ_USER_CASE_HTML_URL', TCM_DOMAIN . '/export_pdf?key=%s'); diff --git a/model/mBase.php b/model/mBase.php index 0af089b..bf72a34 100644 --- a/model/mBase.php +++ b/model/mBase.php @@ -117,16 +117,16 @@ class mBase extends publicBase { public static function sendMail($emails, $title, $content,$attr='') { include_once SERVER_ROOT . '/library/mail/class.phpmailer.php'; - $mail_name = array_rand($GLOBALS['notice_qqmail_list']); + $mail_name = array_rand($GLOBALS['notice_mail_list']); $mail = new PHPMailer(); $mail->IsSMTP(); - $mail->Host = 'smtp.163.com'; - $mail->Port = 587; // TCP 端口 - $mail->SMTPSecure = 'tls'; // 启用 TLS 加密 + $mail->Host = $GLOBALS['notice_mail_list'][$mail_name]['host']; + $mail->Port = 465; // TCP 端口 + $mail->SMTPSecure = 'ssl'; // 启用 TLS 加密 //$mail->SMTPDebug = 2; // 是否开启调试 $mail->Username = $mail_name; - $mail->Password = $GLOBALS['notice_qqmail_list'][$mail_name]; + $mail->Password = $GLOBALS['notice_mail_list'][$mail_name]['password']; $mail->From = $mail_name; $mail->CharSet = "utf-8"; $mail->IsHTML(true);