Browse Source

解决邮件发送时,腾讯企业邮箱返回的错误信息编码影响系统报错的问题

Henry 4 years ago
parent
commit
e0b008097a
1 changed files with 1 additions and 0 deletions
  1. 1 0
      application/common/library/Email.php

+ 1 - 0
application/common/library/Email.php

@@ -219,6 +219,7 @@ class Email
                 preg_match_all("/Expected: (\d+)\, Got: (\d+)( \| (.*))?\$/i", $e->getMessage(), $matches);
                 $code = isset($matches[2][3]) ? $matches[2][3] : 0;
                 $message = isset($matches[2][0]) ? $matches[4][0] : $e->getMessage();
+                $message = mb_convert_encoding($message, 'UTF-8', 'GBK,GB2312,BIG5');
                 $this->setError($message);
             } catch (\Exception $e) {
                 $this->setError($e->getMessage());