I'm trying to instantiate the PHP mailer class which i've installed using composer. The class is located in vendor\phpmailer\phpmailer\class.phpmailer.php
-Project
-src
-SmtpHandler.php
-vendor
-phpmailer
-phpmailer
class.phpmailer.php
index.php
I'm trying to load this class inside SmtpHandler as follows:
<?php
namespace Fusion;
require_once __DIR__ . '/../vendor/autoload.php';
class SmtpHandler {
var $mail;
function __construct () {
$this->mail = new PHPMailer;
my composer.json file is autoloading my php classes like so:
"autoload": {
"psr-4": {
"Fusion\\": "src"
}
},
when $this->mail = new PHPMailer; is called, i recieve an error Fatal error: Class 'Fusion\PHPMailer' not found in /var/www/proj/Project/src/SmtpHandler.php on line 8
Do i need to use vendor\phpmailer\phpmailer\class.phpmailer ? or am i using psr-4 wrong?
Thanks