title: My website sends mail ,gmail, locally but not on server. Unable to connect to ssl://smtp.gmail.com
body: <p>The following is the send_mail() model function that I use to send emails using the 'email', 'subject', and 'content' of message. Locally the website sends emails through gmail perfectly yet, on the hosting server it gives me an SMTP error: 
      unable to connect to ssl://smtp.gmail.com .        </p>
  
  <pre><code>function send_mail( $mail, $subject, $msg )
        {
              $receiver  = $mail;
              $title = $subject;
              $sender  = "Dina";
              $sender_mail = "myemail@gmail.com";
              $message = '&lt;html&gt;&lt;body&gt;';
              //$message .= "Hey $mail,&lt;br&gt;&lt;br&gt;";
              $message .= $msg;
              $message .= "&lt;/body&gt;&lt;/html&gt;";
              $ci = get_instance();
              $ci-&gt;load-&gt;library('email');
              $config['protocol'] = "smtp";
              $config['smtp_host'] = "ssl://smtp.gmail.com";
              $config['smtp_port'] = "465";
              $config['smtp_user'] = "myemail@gmail.com";
              $config['smtp_pass'] = "password";
              $config['charset'] = "utf-8";
              $config['mailtype'] = "html";
              $config['newline'] = "\r\n";
              $ci-&gt;email-&gt;initialize($config);
  
              $ci-&gt;email-&gt;from($sender_mail, $sender);
              $list = array($receiver);
              $ci-&gt;email-&gt;to($list);
              $this-&gt;email-&gt;reply_to('myemail@gmail.com', 'Dina');
              $ci-&gt;email-&gt;subject($title);
              $ci-&gt;email-&gt;message($message);
              // $ci-&gt;email-&gt;send();
              if(!$ci-&gt;email-&gt;send())
              {
                 $this-&gt;email-&gt;print_debugger();
              }
          }
  </code></pre>