title: I'm getting Uncaught Error: Call to a member function isSMTP() on null Error on my Submission of the Form in PHP
body: <p>I'm getting Uncaught Error: Call to a member function isSMTP() on null error in my PHP mailer code. Can anyone tell me what is wrong?</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
   if(isset($_POST["submit"])){
  
      require 'Exception.php';
      require 'PHPMailer.php';
      require 'SMTP.php';
  
      $mail-&gt;isSMTP();
  
      $mail-&gt;Host = 'mail.nsacedu.com';
      $mail-&gt;SMTPAuth = true;
      $mail-&gt;Username = '';
      $mail-&gt;Password = '';
      $mail-&gt;SMTPSecure = 'tls';
      $mail-&gt;Port = 465;  
  
  }
  
  </code></pre>