title: Sending Email using SMTP codeigniter
body: <p>I am trying to send email using smtp codeigniter. The code I am using is as below:</p>
  
  <pre><code>public function notify_marketing(){
      $config = Array(
                      'protocol' =&gt; 'smtp',
                      'smtp_host' =&gt; 'ssl://smtp.googlemail.com',
                      'smtp_port' =&gt; 465,
                      'smtp_user' =&gt; 'myvalidemail@gmail.com', 
                      'smtp_pass' =&gt; '*******',//my valid email password
                      'mailtype' =&gt; 'html',
                      'charset' =&gt; 'iso-8859-1',
                      'wordwrap' =&gt; TRUE
                    );
  
      $this-&gt;email-&gt;initialize($config);
      $this-&gt;load-&gt;library('email', $config);
      $this-&gt;email-&gt;set_newline("\r\n");  
      $this-&gt;email-&gt;from('myvalidemail@gmail.com'); 
      $this-&gt;email-&gt;to('validreceiptent@gmail.com');
      $this-&gt;email-&gt;subject('My Subject');
      $this-&gt;email-&gt;message('Hello there');
      if($this-&gt;email-&gt;send())
      {
          $this-&gt;session-&gt;set_flashdata("success","Email sent.");
      }
       else
      {
          show_error($this-&gt;email-&gt;print_debugger());
      }
  }
  </code></pre>
  
  <p>However I am getting the following error in the response. I tried other solutions from this site but didn't work.</p>
  
  <pre><code>    &lt;div id="exception_error"&gt;
      &lt;h1&gt;&lt;span class="type"&gt;An Error Was Encountered [ 500 ]&lt;/span&gt;&lt;/h1&gt;
      &lt;div class="content"&gt;
          &lt;p&gt;&lt;p&gt;220 smtp.googlemail.com ESMTP bv4sm16669443pbb.86 - gsmtp
  &lt;br /&gt;&lt;pre&gt;hello: 250-smtp.googlemail.com at your service, [110.44.127.179]
  250-SIZE 35882577
  250-8BITMIME
  250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN XOAUTH
  250-ENHANCEDSTATUSCODES
  250-PIPELINING
  250-CHUNKING
  250 SMTPUTF8
  &lt;/pre&gt;lang:email_smtp_auth_pw&lt;br /&gt;lang:email_send_failure_smtp&lt;br /&gt;&lt;pre&gt;User-Agent: CodeIgniter
  Date: Tue, 18 Aug 2015 12:03:42 +0545
  From: &lt;********@gmail.com&gt;
  Return-Path: &lt;********@gmail.com&gt;
  To: *******@gmail.com
  Subject: =?iso-8859-1?Q?My_Subject?=
  Reply-To: "********@gmail.com" &lt;*********@gmail.com&gt;
  X-Sender: *******@gmail.com
  X-Mailer: CodeIgniter
  X-Priority: 3 (Normal)
  Message-ID: &lt;55d2ce42747f5@gmail.com&gt;
  Mime-Version: 1.0
  </code></pre>
  
  <p>Thank you in advance.</p>