I have PHPMailer working in my code in my local enviroment but when I move it to the server I get the following error
Class 'PHPMailer\PHPMailer\PHPMailer' not found
Heres the bit of code that im using:
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
class Email extends EV_DB {
function __construct() {
parent::__construct();
$this->email_common = [
'baseurl' => $_SERVER['HTTP_HOST']
];
$this->stache = new Mustache_Engine(array(
'loader' => new Mustache_Loader_FilesystemLoader( __DIR__ .'/../../mustache'),
'partials_loader' => new Mustache_Loader_FilesystemLoader( __DIR__ .'/../../mustache/partial')
));
$mail = new PHPMailer(true);
...
I installed PHPMailer with composer, and have my codeigniter setup to autoload in a config file, which is why theres not require for the autoload.php. I'm sure this is working correctly since mustache loads just fine, and if I try to manually include the autload file it gives me the error:
Cannot declare class ComposerAutoloaderInitb315d7432979fc7d6789bb454c858180, because the name is already in use.
The difference between my local and live enviroments is that I have the application folder separate from where the index.php lives. So in the index.php I have set:
$application_folder = 'C:\inetpub\my_application\application';
while the index file lives in
C:\inetpub\wwwroot\MyApplication\index.php
Is this location change changing the what the namespace should be set as? I don't really know enough to troubleshoot past this point.