title: Codeigniter SMTP Mail Config
body: <p>I'm trying to send mail via SMTP but probably CI is not recognizing <code>config</code> details, so it tries to connect my own server's <code>SMTP</code>.</p>
  
  <p>This is my code for sending mail:</p>
  
  <pre><code>    $config =   array
      (
      'protocol'      =&gt;  'smtp',
      'smtp_host'     =&gt;  'in-v3.mailjet.com',
      'smtp_port'     =&gt;  '587',
      'smtp_user'     =&gt;  'myusername',
      'smtp_pass'     =&gt;  'mypassword',
      'mailtype'      =&gt;  'html',
      'newline'       =&gt;  '\r\n',
      'charset'       =&gt;  'utf-8',
      'validation'    =&gt;  TRUE
      );
  
      $this-&gt;load-&gt;library('email', $config);
      $this -&gt; email -&gt; from('my@mailaddress.com');
      $this -&gt; email -&gt; to('to@mailaddress.com');
      $this -&gt; email -&gt; subject('mySubject');
      $this -&gt; email -&gt; message('myMessage');
      $this -&gt; email -&gt; send();
  
      echo $this -&gt; email -&gt; print_debugger();
  </code></pre>
  
  <p>And this is my output:</p>
  
  <pre><code>220-server.myserver.com ESMTP Exim 4.86 #2 Wed, 21 Oct 2015 19:38:24 +0300 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail. 
  hello: 250-server.myserver.com Hello li14.members.linode.com [my.ip.address.here]
  250-SIZE 52428800
  250-8BITMIME
  250-PIPELINING
  250-AUTH PLAIN LOGIN
  250-STARTTLS
  250 HELP
  535 Incorrect authentication data 
  </code></pre>
  
  <p>It gives 535 and that's normal 'cause it has to connect mailjet's server, not mine. I tried different config initializing methods but result is same.</p>
  
  <p>Thank in advance.</p>