Can't get PHPMailer to load properly.

Started by Randem, June 01, 2021, 03:45:03 PM

Previous topic - Next topic

Randem

If you are having trouble getting PHPMailer to work, we have created an auto-loader to help. To use it just follow this simple procedure. Download PHPMailer and place in the folder "vendor", change all folders names to lowercase for the PHPMailer folders. Download our Autoloader Class and use the following code. This will load all the needed PHPMailer files needed to run PHPMailer.

//================================================================
// Setup Email Settings
//
// Must be in main section. CANNOT be in a code block!!!
//
// PHPMailer
//================================================================

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
  use PHPMailer\PHPMailer\OAuth;
  use PHPMailer\PHPMailer\SMTP;

$dirs = array(/vendor/phpmailer/phpmailer/src');
$exceptions = array('get_oauth_token.php');

include 'autoload.php';
$PHPMailer_Autoload = new Autoload($dirs, $exceptions);
$PHPMailer_Autoload->load();