title: Message: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Network is unreachable)
body: <p>I kind have been stuck with this error, when i'm using localhost my website sends its mails smoothly, but when I uploaded it to the live server, I got this error.</p>
  
  <pre><code>PHP
  Severity: Warning
  
  Message: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Network is unreachable)
  
  Filename: libraries/Email.php
  
  Line Number: 2055
  </code></pre>
  
  <p>And here is the error message from print_debugger()</p>
  
  <blockquote>
    <p>The following SMTP error was encountered: 101 Network is unreachable
    Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.</p>
  </blockquote>
  
  <p><strong>Here is my codes for email.php</strong></p>
  
  <pre><code>&lt;?php
  
  $config['protocol'] = "smtp";
  $config['smtp_host'] = "ssl://smtp.gmail.com";
  $config['smtp_port'] = 465;
  $config['charset']   = "utf-8";
  $config['newline']   = "\r\n";
  $config['mailtype']  = "html";
  
  $config['smtp_user'] = "**********@gmail.com";
  $config['smtp_pass'] = "**********";
  </code></pre>