title: contact form using phpmailer via SMTP working on localhost but not on server
body: <ul>
  <li><p>List item</p>
  
  <p>
  
  <pre><code>    $mail-&gt;isSMTP();
      $mail-&gt;Host = 'smtp.gmail.com'; 
      $mail-&gt;Port = 587;
      $mail-&gt;SMTPAuth = true; 
      $mail-&gt;SMTPSecure = 'tls';                               
      $mail-&gt;Username = 'xxxxxxxx@gmail.com';                 
      $mail-&gt;Password = 'xxxxxxxxxx';                           
  
      $mail-&gt;setFrom($_POST['email'],$_POST['name']);
      $mail-&gt;addAddress('xxxxxxxxxx@gmail.com');     
      $mail-&gt;addReplyTo($_POST['email'],$_POST['name']);
  
      $mail-&gt;isHTML(true);         
      $mail-&gt;Subject='Intending to: '.$_POST['option'];                        
      $mail-&gt;Body='&lt;h1 align=center&gt; Name :'.$_POST['name'].'&lt;br&gt;Email: '.$_POST['email'].
      '&lt;br&gt;Message: '.$_POST['text'].'&lt;/h1&gt;';
      $mail-&gt;AltBody = 'This is the body in plain text for non-HTML mail clients';
  
      if(!$mail-&gt;send()) {
          $result="Something went wrong. Please try again.";
      }
      else {
          $result="Thank You ".$_POST['name']." for contacting us. We'll get back to you soon!";
      }
  }
  </code></pre>
  
  <p>?>
  //the error I am getting is Fatal error: Uncaught Error: Class 'PHPMailer' not found in /storage/ssd4/215/7577215/public_html/index.php:31 Stack trace: #0 {main} thrown in /storage/ssd4/215/7577215/public_html/index.php on line 5          </p></li>
  </ul>
  
  <p>//This only happens when the file is on the server, on localhost the mail is sent just fine.</p>