wesmiler 3 лет назад
Родитель
Сommit
053c3990d6
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      app/Services/EmailService.php

+ 3 - 2
app/Services/EmailService.php

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