title: Send email by Email Class in codeigniter with Gmail
body: <p>I want send a email by Email Class in codeigniter with gmail, but i get following error:</p>
  
  <p>Error: </p>
  
  <blockquote>
    <p>A PHP Error was encountered <br> Severity: Warning <br> Message:
    mail() [function.mail]: Failed to connect to mailserver at
    "ssl://smtp.googlemail.com" port 25, verify your "SMTP" and
    "smtp_port" setting in php.ini or use ini_set() <br> Filename:
    libraries/Email.php <br> Line Number: 1553  <br></p>
  </blockquote>
  
  <p>This is my full function in controll:</p>
  
  <pre><code>function send_mail(){
  $config['protocol'] = 'smtp';
  $config['smtp_host'] = 'ssl://smtp.googlemail.com';
  $config['smtp_port'] = 465;
  $config['smtp_user'] = 'xyz@gmail.com';
  $config['smtp_pass'] = 'xxxxxxx';
  
  $this-&gt;load-&gt;library('email', $config);
  $this-&gt;email-&gt;set_newline("\r\n");
  
  $this-&gt;email-&gt;from('neginph@gmail.com', 'Negin Phosphate Shomal');
  $this-&gt;email-&gt;to('neginfos@yahoo.com');
  $this-&gt;email-&gt;subject('This is an email test');
  $this-&gt;email-&gt;message('It is working. Great!');
  
  if($this-&gt;email-&gt;send())
  {
      echo 'Your email was sent, successfully.';
  }
  
  else
  {
      show_error($this-&gt;email-&gt;print_debugger());
  }
  }
  </code></pre>
  
  <p>I changed SMTP in <code>php.ini</code> as this:</p>
  
  <blockquote>
    <p>SMTP = ssl://smtp.googlemail.com<br> smtp_port = 25</p>
  </blockquote>
  
  <p>What do i do?</p>
  
  <p>With respect</p>