title: codeigniter : Message: Class 'PHPMailer' not found
body: <p>i am trying to send email using  PHP mailer in codeigniter. Below is my code</p>
  <p>below 3 files are added to      <strong>/project/application/third_party</strong></p>
  <ol>
  <li>PHPMailer.php</li>
  <li>Exception.php</li>
  <li>SMTP.php</li>
  </ol>
  <p>in my <strong>/project/application/libraries</strong> i have below</p>
  <pre><code>&lt;?php
  defined('BASEPATH') OR exit('No direct script access allowed');
  
  use PHPMailer\PHPMailer\PHPMailer;
  use PHPMailer\PHPMailer\Exception;
  class Mailer{
      public function __construct(){
          log_message('Debug', 'PHPMailer class is loaded.');
      }
  
      public function load(){
          // Include PHPMailer library files
          require_once APPPATH.'third_party/Exception.php';
          include APPPATH.'third_party/PHPMailer.php';
          require_once APPPATH.'third_party/SMTP.php';
  
          $mail = new PHPMailer(true);
          return $mail;
      }
  }
  </code></pre>
  <p>In my Controller :</p>
  <pre><code>class Email extends CI_Controller {
  
      public function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;library('Mailer');
      }
      function sendemail(){
         // echo APPPATH.'third_party/PHPMailer.php';
          $mail = $this-&gt;mailer-&gt;load();             
          try {
              $mail-&gt;isSMTP();                                            // Send using SMTP
              $mail-&gt;Host       = '*****'; 
              $mail-&gt;SMTPAuth   = true;    
              $mail-&gt;Username   = '*****';                     // SMTP username
              $mail-&gt;Password   = 'secret';                               // SMTP password
              $mail-&gt;SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;         // Enable TLS encryption; 
              $mail-&gt;Port       = 587;  
              $mail-&gt;setFrom('email@email.com', 'Reliet');
              $mail-&gt;addAddress('receivere@gmail.com', 'John');     
              $mail-&gt;addReplyTo('infom@email.com', 'Information');   
  
              $mail-&gt;isHTML(true);                                   
              $mail-&gt;Subject = 'Here is the subject';
              $mail-&gt;Body    = 'This is the HTML message body &lt;b&gt;in bold!&lt;/b&gt;';
              $mail-&gt;AltBody = 'This is the body in plain text for non-HTML mail clients';
  
              $mail-&gt;send();
              echo 'Message has been sent';
          } catch (Exception $e) {
              echo &quot;Message could not be sent. Mailer Error: {$mail-&gt;ErrorInfo}&quot;;
          }
      }
  </code></pre>
  <p>Below is the error</p>
  <blockquote>
  <p>An uncaught Exception was encountered Type: Error</p>
  <p>Message: Class 'PHPMailer' not found</p>
  </blockquote>
  <p>Please guide me where am i doing wrong</p>