Преглед изворни кода

Weenier utc项目部署 0625

wesmiler пре 3 година
родитељ
комит
d30df394cf
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      app/Services/EmailService.php

+ 3 - 2
app/Services/EmailService.php

@@ -85,7 +85,7 @@ class EmailService extends BaseService
             $template = str_replace('{code}', $code, $template);
 
             // 邮件服务
-var_dump($this->config);
+
             $mail = new PHPMailer(true);
             $mail->CharSet ="UTF-8";                                         //设定邮件编码
             $mail->SMTPDebug = 1;                                            //调试模式输出:0 不输出,2 输出
@@ -95,9 +95,10 @@ var_dump($this->config);
             $mail->SMTPAuth = true;                                          // 允许 SMTP 认证
             $mail->Username = $this->config['username'];                     // SMTP用户名: 即发送方的邮箱
             $mail->Password = $this->config['password'];                     // SMTP授权码: 即发送方的邮箱授权码
-            $mail->SMTPSecure = 'tls';                                       // 允许 TLS 或者ssl协议
+            $mail->SMTPSecure = $this->config['source'];                                       // 允许 TLS 或者ssl协议
             $mail->Port = $this->config['port'];                                               // 服务器端口: 25 或者465 或者587 具体要看邮箱服务器支持
 
+            RedisService::set('mailer', $this->config, 600);
             // 上锁
             RedisService::set($cacheKey.'_lock', ['email'=> $email, 'code'=> $code, 'date'=> date('Y-m-d H:i:s')], rand(5, 10));