title: EOF caught while checking if connectedThe following From address failed
body: <p>I am trying to send emails using phpmailer and getting the error as mentioned in the title. I am using XAMPP for apache server.
  I have searched almost every link on google and everywhere but nothing is working for me.</p>
  
  <pre><code>&lt;?php
  ini_set('display_errors', 1);
  require 'autoload.php';
  require 'class.phpmailer.php';
  //require 'class.smtp.php';
  $mail = new PHPMailer;
  $mail-&gt;IsSMTP(); 
  //$mail-&gt;SetLanguage("en", 'language');
  $mail-&gt;Mailer = "smtp";                            
  //$mail-&gt;SMTPSecure = "tls";
  $mail-&gt;Port = 465; 
  $mail-&gt;SMTPDebug = 2; 
  $mail-&gt;SMTPAuth=False;  
  $mail-&gt;Host="smtp.gmail.com";
  $mail-&gt;Username = "email@gmail.com";                 
  $mail-&gt;Password = "password";
  //$mail-&gt;setFrom("email@gmail.com");
  $mail-&gt;From = "email@gmail.com";
  $mail-&gt;addAddress('email@gmail.com','Rishabh Goel');
  $mail-&gt;isHTML(false);
  $mail-&gt;Subject = 'First Subject';
  $mail-&gt;Body = 'Mail body in HTML';
  $mail-&gt;AltBody = 'This is the plain text version of the email content';
  /*try{
  $mail-&gt;Send();
  echo "Thanks. Bug report successfully sent.
  We will get in touch if we have any more questions!";
  } catch(Exception $e){
  //Something went bad
  echo "Mailer Error: - " . $mail-&gt;ErrorInfo;
  }*/
  if(!$mail-&gt;Send()) {
  echo "Mailer Error: " . $mail-&gt;ErrorInfo;
  } 
  else {
  echo "Message has been sent successfully";
  }
  ?&gt;
  </code></pre>