title: PHPMailer only sends email when SMTPDebug = true
body: <p>I'm using PHPmailer. It works when $mail->SMTPDebug = true; but when I remove that line, it silently fails. I say silently fails as it doesn't give any errors, and yet the email doesn't seem to be delivered.</p>
  
  <pre><code>        $mail = new PHPMailer;
  
          $mail-&gt;SMTPDebug = true;
          $mail-&gt;SMTPAuth = true;
          $mail-&gt;CharSet = 'utf-8';
          $mail-&gt;SMTPSecure = 'ssl';
          $mail-&gt;Host = 'smtp.gmail.com';
          $mail-&gt;Port = '465';
          $mail-&gt;Username = 'xxxxx@gmail.com';
          $mail-&gt;Password = 'xxxxx';
          $mail-&gt;Mailer = 'smtp';
          $mail-&gt;AddReplyTo('support@xxxxx.com', 'xxxxx Support');
          $mail-&gt;From = 'xxxxx@gmail.com';
          $mail-&gt;FromName = 'xxxxx Applications';
          $mail-&gt;Sender = 'xxxxx Applications';
          $mail-&gt;Priority = 3;
  
          //To us
          $mail-&gt;AddAddress('xxxxx@xxxxx.com', 'xxxxx xxxxx');
          //To Applicant
          $mail-&gt;AddAddress($email, $first_name.''.$last_name);
          $mail-&gt;IsHTML(true);
  
          $last_4_digits = substr($card_num, -4);
          //build email contents
  
          $mail-&gt;Subject = 'Application From '.$first_name.' '.$last_name;
          $mail-&gt;Body    = $body_html;
          $mail-&gt;AltBody = $body_text;
  
          if(!$mail-&gt;send()) {
             echo 'Message could not be sent.';
             echo 'Mailer Error: ' . $mail-&gt;ErrorInfo;
             exit;
          }
  </code></pre>