title: codeigniter multiple file filed send in email
body: <p>How to send multiple file filed in email attachment. </p>
  
  <p>in views file </p>
  
  <pre><code>  &lt;input type="file" name="attachment" id="file_1" /&gt;
    &lt;input type="file" name="attachmenttwo" id="file_2" /&gt;
    &lt;input type="file" name="attachmentthree" id="file_3" /&gt;
  </code></pre>
  
  <p>in my controller</p>
  
  <pre><code> $config['upload_path'] = './uploads/';
   $config['allowed_types'] = 'gif|jpg|png|txt';
   $config['max_size'] = '100000';
   $config['overwrite'] = TRUE;
   $config['encrypt_name'] = TRUE;
   $this-&gt;load-&gt;library('upload', $config);
   $this-&gt;load-&gt;library('email');
   $this-&gt;load-&gt;library('encrypt');
   $this-&gt;upload-&gt;initialize($config);
   $this-&gt;upload-&gt;do_upload('attachment');
   $this-&gt;upload-&gt;do_upload('attachmenttwo');
   $this-&gt;upload-&gt;do_upload('attachmenthree');
   $ret = $this-&gt;upload-&gt;data();
   $rettwo = $this-&gt;upload-&gt;data();
   $retthree = $this-&gt;upload-&gt;data();
   $pathToUploadedFile = $ret['full_path'];
   $pathToUploadedFiletwo = $rettwo['full_path'];
   $pathToUploadedFilethree = $retthree['full_path'];
   $this-&gt;email-&gt;from('abc@gmail');
   $this-&gt;email-&gt;to('bcd@gmail.com');
   $this-&gt;email-&gt;subject('New query');
   $this-&gt;email-&gt;message('hi');
   $this-&gt;email-&gt;attach($pathToUploadedFile);
   $this-&gt;email-&gt;attach($pathToUploadedFiletwo);
   $this-&gt;email-&gt;attach($pathToUploadedFilethree);
   $this-&gt;email-&gt;send();
  </code></pre>
  
  <p>here is  i am able to upload file in server successfully but not able to send attachment in email, i received last file 3 time in my inbox.</p>
  
  <p>suggest me how to send all files in mail inbox </p>