title: Setting up multiple email configurations in Code Igniter using config/email.php
body: <p>I am using Code Igniter 2.0.3.</p>
  
  <p>I am having various roles in my application and I want to set up various email configurations depending upon those roles.</p>
  
  <p>As per <a href="http://codeigniter.com/user_guide/libraries/email.html" rel="nofollow">this</a> we can set up the configurations in config/email.php for one account, but I want to set up multiple accounts, so that depending upon the role I just call the role at run time and my settings are initialized automatically.</p>
  
  <p>Sample code could be</p>
  
  <pre><code>$config['first_setting']['protocol'] = 'sendmail';
  $config['first_setting']['mailpath'] = '/usr/sbin/sendmail';
  $config['first_setting']['charset'] = 'iso-8859-1';
  $config['first_setting']['smtp_user'] = 'j@j.j';
  $config['first_setting']['wordwrap'] = TRUE;
  
  $this-&gt;email-&gt;initialize($config['first_seeting']);
  </code></pre>
  
  <p>Gracias.</p>