title: Can't send email from gmail in codeigniter, SMTP Authentication error
body: <p>I'm trying to send an email in codeigniter, but something wrong and i dont know how to fix it.
  It success when I send in localhost, but when I upload my app into host, it cant send. This is my code</p>
  
  <pre><code>        $this-&gt;load-&gt;library('email');
          $config['protocol']    = 'smtp';
          $config['smtp_host']    = 'ssl://smtp.gmail.com';
          $config['smtp_port']    = '465';
          $config['smtp_timeout'] = '7';
          $config['smtp_user']    = 'username';
          $config['smtp_pass']    = '****';
          $config['charset']    = 'utf-8';
          $config['newline']    = "\r\n";
          $config['mailtype'] = 'html'; // or html
          $config['validation'] = TRUE; // bool whether to validate email or not 
          $this-&gt;email-&gt;initialize($config);
  
          $this-&gt;email-&gt;send();
  
          echo $this-&gt;email-&gt;print_debugger();
  </code></pre>
  
  <p>And this is my error when I submit an email</p>
  
  <pre><code>Failed to authenticate password. Error: 535 Incorrect authentication data 
  
  *from: 250 OK
  to: 550-Please turn on SMTP Authentication in your mail client, or login to the
  550-IMAP/POP3 server before sending your message.  mb2d247.vdrs.net
  550-(hanghieunara.com) [112.78.2.247]:51939 is not permitted to relay through
  550 this server without authentication.*
  
  The following SMTP error was encountered: 550-Please turn on SMTP Authentication in your mail client, or login to the 550-IMAP/POP3 server before sending your message.
  
  mb2d247.vdrs.net 550-(hanghieunara.com) [112.78.2.247]:51939 is not permitted to relay through 550 this server without authentication. 
  </code></pre>