简体   繁体   English

PHPMailer 找不到 SMTP 类

[英]PHPMailer can't find SMTP class

i've installed PHPMailer over composer on hostinger.com (webhost).我已经在 hostinger.com (webhost) 上通过 composer 安装了 PHPMailer。 The original version of PHPMailer was 5.0 so I upgraded to 6.6 after i came across this error when submitting a ContactForm7 WordPress plugin form. PHPMailer 的原始版本是 5.0,所以我在提交 ContactForm7 WordPress 插件表单时遇到此错误后升级到 6.6。

Fatal error: Uncaught Error: Class 'PHPMailer\PHPMailer\SMTP' not found in /home/uxxxxxxxx/domains/rebelcitytour.com/public_html/staging25/wp-includes/PHPMailer/PHPMailer.php:1953

I've upgraded to version 6.6 of PHPMailer, I've checked the PHPMailer folder.我已经升级到 PHPMailer 6.6 版,我检查了 PHPMailer 文件夹。 It exists.它存在。 And has three files in it...里面有三个文件...

Exception.php  PHPMailer.php  SMTP.php

Yet, the plugin PHP code can't seem to find SMTP class?然而,插件 PHP 代码似乎找不到 SMTP 类? Weird right?很奇怪吧?

I've included this code in load.php of my plugin root director...我已将此代码包含在我的插件根目录的 load.php 中......

require_once '/staging25/wp-includes/PHPMailer/SMTP.php';    

Link to bug on system 链接到系统上的错误

Yes, like suggested above.是的,就像上面建议的那样。 It was a namespace issue caused by a dev declaring a global variable in local scope.这是由开发人员在本地范围内声明全局变量引起的名称空间问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM