I've always sent from PHPMailer with ease, it always works well. However, after updating to the newer version, I ran composer install within the PHPMailer directory and then ran composer require phpmailer/phpmailer within the directory my functions file is at, which sends the email. Hoping this would work well. However, when I used the example to try and send a test email, an error arose: Parse error: syntax error, unexpected 'use' (T_USE) I don't understand what went wrong.
use PHPMailerPHPMailerPHPMailer;
use PHPMailerPHPMailerException;
I then required once the autoload file which loaded fine.
Any ideas?
Nevermind, it was inside a function instead of at the top of the PHP file.
Most helpful comment
Nevermind, it was inside a function instead of at the top of the PHP file.