phpmailer.class.php 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * ZenTaoPMS - Open-source project management system.
  4. *
  5. * @copyright Copyright 2009-2025 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.chandao.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. *
  8. * A third-party license is embedded for some of the code in this file:
  9. * The use of the source code of this file is also subject to the terms
  10. * and consitions of the license of "PHPMailer" (LGPL, see
  11. * </lib/vendor/phpmailer/phpmailer/LICENSE>).
  12. */
  13. require_once dirname(__FILE__, 2) . '/base/delegate/delegate.class.php';
  14. class phpmailer extends baseDelegate
  15. {
  16. protected static $className = 'PHPMailer\PHPMailer\PHPMailer';
  17. public function __construct($exceptions = null)
  18. {
  19. $this->instance = new static::$className($exceptions);
  20. // 修复 phpmailer 6.x SSL 验证失败的问题。详见https://www.php.net/manual/zh/context.ssl.php。Fix the SSL verification failure of phpmailer 6.x. See https://www.php.net/manual/en/context.ssl.php.
  21. $this->instance->SMTPOptions = [
  22. 'ssl' => [
  23. 'verify_peer' => false,
  24. 'verify_peer_name' => false
  25. ]
  26. ];
  27. }
  28. }