Welcome Guest, Not a member yet? Register   Sign In
Class "PHPMailer\PHPMailer\PHPMailer" not found
#2

(This post was last modified: 08-31-2022, 07:16 AM by captain-sensible. Edit Reason: extra added )

I use phpmailer and it works a treat. Structure of my app is :


Code:
[andrew@darkstar:/srv/http]$ tree -L 1 ads.com                                                                                                                (08-31 15:08)
ads.com
├── 1.png
├── app
├── bootstrapCss
├── bootstrapS
├── builds
├── composer.json
├── composer.lock
├── env
├── fontawesome
├── Gruntfile.js
├── Gruntfile.js.bk
├── Gruntfile.js.save
├── gulpfile.js
├── license.txt
├── node_modules
├── package.json
├── package-lock.json
├── PHPMailer
├── phpunit.xml.dist
├── public
├── README.md
├── scss
├── spark
├── tecnickcom
├── tests
├── vendor
└── writable

/app/config/Autolaod.php is "

Code:
    public $psr4 = [
        APP_NAMESPACE => APPPATH, // For custom app namespace
        
        
        'Config'      => APPPATH . 'Config',
        'PHPMailer\\PHPMailer'=> ROOTPATH.'PHPMailer/src',
        
        
    ];


And in controller to use it :

Code:
<?php namespace App\Controllers;

use CodeIgniter\Controller;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\OAuth;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\SMTP;
use \App\Andy\CheckSpam;
use \App\Andy\Utility;
use CodeIgniter\I18n\Time;

//then to instantiate

                      $mail = new PHPMailer(true);


structure of PHPMAiler directory is:

Code:
                  

andrew@darkstar:http/ads.com]$ tree PHPMailer -L 1                                                                                                           (08-31 15:14)
PHPMailer
├── COMMITMENT
├── composer.json
├── get_oauth_token.php
├── language
├── LICENSE
├── README.md
├── SECURITY.md
├── src
└── VERSION

the classes for phpmailer are of course in source
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply


Messages In This Thread
RE: Class "PHPMailer\PHPMailer\PHPMailer" not found - by captain-sensible - 08-31-2022, 07:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB