【发布时间】:2020-08-17 16:42:38
【问题描述】:
我在设置 PHPMailer 时遇到问题。它以前可以工作,但现在突然停止了,这是我得到的错误:
PHP Fatal error: require(): Failed opening required '../src/PHPMailer.php' (include_path='.:/opt/cpanel/ea-php53/root/usr/share/pear:/opt/cpanel/ea-php53/root/usr/share/php') in /home/pandatra/site.com/contacts_form/contact_form.php on line 9
这是contact_form.php中的代码:
<?php
include 'config.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\SMTP;
require ''.$d['include_path'].'PHPMailer/src/Exception.php';
require ''.$d['include_path'].'PHPMailer/src/PHPMailer.php';
require ''.$d['include_path'].'PHPMailer/src/SMTP.php';
$mail = new PHPMailer(true);
if (isset($_POST['Send'])) {
如何解决这个问题?有任何想法吗?我下载了 6.1.7 版本的 PHPMailer。
【问题讨论】:
-
您需要确定您的 PhpMailer 在哪里,以及路径是否已更改。
-
您好,谢谢您的回答。路径没有改变。我只是用新版本替换了旧版本。