title: PHPMailer SMTP Class not found
body: <p>I am not sure what i am doing wrong. I have followed the tutorials line by line and not sure why im am getting this error. My php mailer code is as follows.</p>
  
  <pre><code>use PHPMailer\PHPMailer\PHPMailer;
  use PHPMailer\PHPMailer\Exception;
  
  require dirname($_SERVER['DOCUMENT_ROOT'])."/private/PHPMailer-master/src/Exception.php";
  require dirname($_SERVER['DOCUMENT_ROOT'])."/private/PHPMailer-master/src/PHPMailer.php";    
  require dirname($_SERVER['DOCUMENT_ROOT'])."/private/PHPMailer-master/src/SMTP.php";
  
  // Instantiation and passing `true` enables exceptions
  $mail = new PHPMailer(true);
  
  try {
      //Server settings
      $mail-&gt;SMTPDebug = SMTP::DEBUG_SERVER;                     
      $mail-&gt;isSMTP();                                            
      $mail-&gt;Host       = 'a2plcp473.prod.iad.secureserver.net';          
      $mail-&gt;SMTPAuth   = true;                                  
      $mail-&gt;Username   = 'ew@myemail.com';                     
      $mail-&gt;Password   = 'xxx';                            
      $mail-&gt;SMTPSecure =  'tls' ;                                
      $mail-&gt;Port       = 465;                                   
  
      //Recipients
      $mail-&gt;setFrom('ew@mymail.com', 'Name');
      $mail-&gt;addAddress('ew@othermail.com', 'Name');     
      $mail-&gt;addReplyTo('ew@othermail.com', 'Name');
  
      // Content
      $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 "Message could not be sent. Mailer Error: {$mail-&gt;ErrorInfo}";
  }
  </code></pre>
  
  <p>I know my file paths are correct because i put a echo "This" in each file and it's echoing back out to the screen. So the paths are correct. </p>
  
  <p>The error im getting is:</p>
  
  <pre><code>Fatal error: Uncaught Error: Class 'SMTP' not found in 
  /home/xxx/public_html/public/internal/mail.php:23 Stack trace: #0 {main} thrown in 
  /home/xxx/public_html/public/internal/mail.php on line 23
  </code></pre>
  
  <p>Line 23 is: </p>
  
  <pre><code>$mail-&gt;isSMTP(); 
  </code></pre>
  
  <p>Im stuck here. I have been searching online for solutions for two days now. Any help would be appreciated. Thanks. I also know there is other post like this on stack but i have tried all of those and can't get it to work. Likewise, most of them are for people using composer and i am not using composer, im just including the file path. Also most of them use and autoloader which was deprecated recently. Please help. Thanks.</p>