Answer the question
In order to leave comments, you need to log in
How to connect the new version of PHPMailer 6.0.5?
Good afternoon!
I can’t figure out how to connect the new version of PHPMailer, the files have become much smaller and the connection principle is different.
The example says to connect like this:
use PHPMailer\PHPMailer\PHPMailer;
date_default_timezone_set('Etc/UTC');
require '../vendor/autoload.php';
$mail = new PHPMailer;
use inc\PHPMailer;
date_default_timezone_set('Etc/UTC');
require '../vendor/autoload.php';
$mail = new PHPMailer;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'path/to/PHPMailer/src/Exception.php';
require 'path/to/PHPMailer/src/PHPMailer.php';
require 'path/to/PHPMailer/src/SMTP.php';
Answer the question
In order to leave comments, you need to log in
PHPMailer apparently should be in the vendor (Connect via composer)
Although, if the second example is from the documentation, it should also work.
It's just that they didn't spell it out carefully.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question