Error: Language string failed to load: instantiate

Error: Language string failed to load: instantiate

我正在发送一些电子邮件,PHPMailer 在我的测试服务器上运行良好。

现在,在我将其移至生产服务器后,我的 none 邮件将被触发,并且我收到

邮件程序错误:无法加载语言字符串:实例化。

我一直在谷歌搜索和使用 phpmailer 来查看似乎是什么问题,根据我收集到的信息,我无法发出常规的 php mail() 请求(这是需要 return true 才能停止错误的 var。

我正在发送一些电子邮件,PHPMailer 在我的测试服务器上运行良好。

try {
            $mail->SMTPDebug = 0;                                       // Enable verbose debug output
            $mail->isSMTP();                                            // Set mailer to use SMTP
            $mail->Host       = 'smtp.gmail.com';                       // Specify main and backup SMTP servers
            $mail->SMTPAuth   = true;                                   // Enable SMTP authentication
            $mail->Username   = $mail_user_name;                        // SMTP username
            $mail->Password   = $mail_user_password;                    // SMTP password
            $mail->SMTPSecure = 'tls';                                  // Enable TLS encryption, `ssl` also accepted
            $mail->Port       = 587;                                    // TCP port to connect to

            //Recipients

            $mail->setFrom($customerservice_email, $customerservice_name);
            $mail->addAddress('email@gmail.com'); // reciever email address
            // $mail->addAddress('info@akhil.com');     // Add a recipient
            // $mail->addAddress($to);
            $mail->SetLanguage('en');
            $mail->isHTML(true);                                  // Set email format to HTML
            $mail->Subject = $subject;
            $mail->MsgHTML($message);

            if($mail->send()){
                return true;
            }
            return false;
        }
        catch (Exception $e) {
            print_r($e);die;
            return false;
        }

有谁能帮我解决一下吗?在这一点上它变得非常沮丧。

一如既往,read the docs。从字面上看,它告诉您的第一件事是 确保您是 运行 最新版本, 而您没有这样做。多年前,PHPMailer 中删除了“语言字符串”错误消息。升级,问题就会消失。

在那之后你可能仍然有问题,但不管是什么问题,它可能会包含在同一个故障排除指南中。