PhpMailer SMTP NOTICE: EOF caught while checking if connected : <p>I got an issue with phpMailer, i can't send any e-mail, and it gives me this error:</p>

<pre><code>2016-03-03 21:32:09 SERVER -&gt; CLIENT: 2016-03-03 21:32:09 SMTP NOTICE: EOF caught while checking if connected 2016-03-03 21:32:09 SMTP Error: Could not authenticate. 2016-03-03 21:32:09 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Erreur : SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting 
</code></pre>

<p>This is my code :</p>

<pre><code>&lt;?php require('phpmailer/PHPMailerAutoload.php'); 
$mail = new PHPMailer();
$mail-&gt;IsSMTP();
$mail-&gt;Host = 'ssl://smtp.gmail.com';
$mail-&gt;SMTPAuth= true;
$mail-&gt;Username='myadress@gmail.com';
$mail-&gt;Password='passwordgmail';
$mail-&gt;Port = 587; 
$mail-&gt;SMTPDebug = 2; 
$mail-&gt;SMTPSecure = 'ssl';
$mail-&gt;SetFrom('myadress@gmail.com', 'Name');
$mail-&gt;AddAddress('someone@gmail.com', 'HisName');
$mail-&gt;Subject = 'Subject';
$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";
if(!$mail-&gt;Send()) {
echo 'Error : ' . $mail-&gt;ErrorInfo;
} else {
    echo 'Ok!!';
  } 
?&gt;
</code></pre>

<p>I tried all the answers i found, but none of them worked so far. I also tried other ports, the 25 and 465 don't work and give me other errors. If someone could help me please it would be really nice =) . Thank you</p>
