title: Problem using CodeIgniter to send emails through Gmail?
body: <p>I'm trying to send an email in codeigniter via my Gmail account. My current code looks like this: </p>
  
  <pre><code>$config = Array(
       'protocol' =&gt; 'smtp',
       'smtp_host' =&gt; 'ssl://smtp.googlemail.com',
       'smtp_port' =&gt; 465,
       'smtp_user' =&gt; 'me@gmail.com',
       'smtp_pass' =&gt; 'my_gmail_password',
       'mailtype'  =&gt; 'html',
       'charset'   =&gt; 'iso-8859-1'
  );
  
  $this-&gt;load-&gt;library('email', $config);
  $this-&gt;email-&gt;set_newline("\r\n");
  $this-&gt;email-&gt;from('me@gmail.com', 'Me');
  $this-&gt;email-&gt;to("me@gmail.com");
  $this-&gt;email-&gt;subject('A test email from CodeIgniter using Gmail');
  $this-&gt;email-&gt;message("A test email from CodeIgniter using Gmail");
  
  $this-&gt;email-&gt;send();
  </code></pre>
  
  <p>However, this gives me the following errors:</p>
  
  <pre><code>Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.googlemail.com:465 (Connection timed out)
  Filename: libraries/Email.php
  
  Message: fwrite(): supplied argument is not a valid stream resource
  
  Message: fgets(): supplied argument is not a valid stream resource
  </code></pre>
  
  <p>Any help to resolve this issue would be much appreciated! Thanks!</p>
  
  <p><em>Note: I can assure you that my Gmail email &amp; password are correct</em></p>