Fatal error: Class 'PHPMailer' not found
That is the error that comes up but I have tried everything.
$mail = new PHPMailer;
$mail->IsSMTP(); // Enable SMTP
$mail->Host = "secret"; //SMTP server Take 163 mailbox as an example
$mail->Port = 465; //email-sending-port
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->SMTPSecure = 'ssl';
$mail->CharSet = 'UTF-8'; //character set
$mail->Encoding = "base64"; //encoding style
$mail->Username = "secret"; //your email
$mail->Password = "secret"; //your password
$mail->Subject = "secret"; //Mail Subject
$mail->From = "secret"; //Sender address (aka your email)
$mail->FromName = "secret"; //Sender Name
$mail->setFrom('secret', 'secret');
$address = $_POST['email'];//recipient email
$mail->AddAddress($address, $_POST['username']);//Add recipient (address, nickname)
$mail->IsHTML(true); //support html content
$mail->Body = "<p>secret</p> ";
.. And this is right at the top:
require 'inc/pages/vendor/autoload.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;```