title: PHP SMTP issue - unable to connect to ssl
body: <p>I am using smtp mail setting and send mail successfully, but some time get below error, please help me what is error in code.</p>
  
  <p><strong>----ERROR---</strong></p>
  
  <blockquote>
    <p>283 and in the
    file:home/xxx/public_html/xxx/class.smtp.php</p>
    
    <p>stream_socket_client(): unable to connect to
    ssl://smtp-relay.gmail.com:465 (Network is unreachable)</p>
  </blockquote>
  
  <pre><code>Array
  (
      [host] =&gt; ssl://smtp-relay.gmail.com
      [port] =&gt; 465
      [timeout] =&gt; 300
      [options] =&gt; Array (  )
      [streamok] =&gt; 1
      [errno] =&gt; 0
      [errstr] =&gt;
      [socket_context] =&gt; Resource id #66
  )
  </code></pre>
  
  <hr>
  
  <pre><code># SMTP Settings
  $mail-&gt;Host = 'smtp-relay.gmail.com';
  $mail-&gt;Port = '465';
  $mail-&gt;Username = 'noreply@xxxxxx.co.xx';
  $mail-&gt;Password = '$$xxxxxxxx$$';
  $mail-&gt;SMTPSecure = 'ssl';
  $mail-&gt;SMTPAuth = true; 
  $mail-&gt;IsSMTP(); 
  $mail-&gt;IsHTML(true);
  $mail-&gt;SetFrom($GLOBALS["smtp_from_email"], $GLOBALS["smtp_from_name"]);
  $mail-&gt;CharSet = 'UTF-8';
  # SMTP Settings
  </code></pre>