title: Codeigniter SMTP Email Error
body: <p>I can't get my emails to send when using SMTP with my codeigniter app.</p>
  
  <p>There are many similar questions on SO, but none that solve my problem so that's why I'm asking again.</p>
  
  <p>Here's the error i'm getting:</p>
  
  <pre><code>hello: 
  
  The following SMTP error was encountered:
  Failed to send AUTH LOGIN command. Error:
  
  from: 
  
  The following SMTP error was encountered:
  
  to: 
  
  The following SMTP error was encountered:
  
  data: 
  
  The following SMTP error was encountered:
  
  The following SMTP error was encountered:
  Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
  
  User-Agent: CodeIgniter
  Date: Tue, 22 Apr 2014 22:54:12 -0400
  From: 
  Return-Path: 
  To: myemail@gmail.com
  Subject: =?utf-8?Q?Request_from_C&amp;J_Builders_Contact_form?=
  Reply-To: "donotreply@C&amp;JBuilders.us" 
  X-Sender: donotreply@C&amp;JBuilders.us
  X-Mailer: CodeIgniter
  X-Priority: 3 (Normal)
  Message-ID: &lt;53572b54551be@C&amp;JBuilders.us&gt;
  Mime-Version: 1.0
  
  
  Content-Type: text/plain; charset=utf-8
  Content-Transfer-Encoding: 8bit
  
  From: jeff
  Email: jeff@gmail.com
  Phone: 555555555
  Message: asdfs fds
  
  Here's my config/email.php:
  &lt;?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
  
  $config['useragent'] = "CodeIgniter";
  $config['protocol'] = "smtp";
  $config['_smtp_auth']   = TRUE;
  $config['smtp_host'] = "smtp.zoho.com";
  $config['smtp_user'] = "donotreply@cjbuilders.info";
  $config['smtp_pass'] = "mypassword";
  $config['smtp_port'] = 465;
  $config['wordwrap'] = TRUE;
  $config['wrapchars'] = 76;
  $config['mailtype'] = "text";
  $config['charset'] = "utf-8";
  $config['validate'] = FALSE;
  $config['priority'] = 3;
  $config['crlf'] = "\r\n";
  $config['newline'] = "\r\n";
  $config['bcc_batch_mode'] = TRUE;
  $config['bcc_batch_size'] = "200";
  
  ?&gt; 
  </code></pre>
  
  <p>Here's my controller snippet that sends the email:</p>
  
  <pre><code>// sends the email to 
  $this-&gt;email-&gt;from('donotreply@C&amp;JBuilders.us');
  $this-&gt;email-&gt;to('myemail@gmail.com');
  $this-&gt;email-&gt;subject('Request from C&amp;amp;J Builders Contact form');
  $this-&gt;email-&gt;message('From: '.$this-&gt;input-&gt;post('name')."\n".
                'Email: '.$this-&gt;input-&gt;post('email')."\n".
                'Phone: '.$this-&gt;input-&gt;post('phone')."\n".
                'Message: '.$this-&gt;input-&gt;post('message')."\n");
  $this-&gt;email-&gt;send();
  echo $this-&gt;email-&gt;print_debugger();
  </code></pre>