title: codeigniter email function not working fine while sending multiple emails with an attachments
body: <p>here is code for sending emails for multiple with an attachment.the loop was running for 1st time only.so it was sending the mail to 1st person and all the remaining was not getting mails.here is my code.since i'm for working from 2days on it.still i didn't get where i had done a mistake.i hope this is best time to learn from you guys.here is my code.</p>
  
  <blockquote>
  <pre><code>&lt;?php
  foreach ($ids as $key =&gt; $value) 
       {
                    $where['applicant_id']=$value;
                    $this-&gt;db-&gt;trans_start(); 
                    $this-&gt;db-&gt;where($where);
            $result=$this-&gt;db-&gt;get('applicant');
            if($this-&gt;db-&gt;trans_status() === FALSE)
            {
            $this-&gt;db-&gt;trans_rollback();
            }
            else
            {
            $check++;
            $array=$result-&gt;row_array();
            $this-&gt;db-&gt;trans_complete(); $update_data[$key]=array('applicant_id'=&gt;$array['applicant_id'],'status'=&gt;'SHORTLISTED');
      $subject='Congratualations You Had Short Listed For Singing Competition';
  
               $array['title']='Admitcard';
               $data=$array; 
  
               $this-&gt;email-&gt;set_mailtype('html');
               $this-&gt;email-&gt;from('xxx@gmail.com','xxxcompetations');
               $this-&gt;email-&gt;to($array['email']);
               $this-&gt;email-&gt;bcc('xxx51@gmail.com');
               $this-&gt;email-&gt;subject($subject);
               $this-&gt;email-&gt;message($message);
               $this-&gt;pdf-&gt;load_view('admitcard',$data);
               $name=random_string('alnum', 9);
               $this-&gt;pdf-&gt;render();
               $pdf = $this-&gt;pdf-&gt;output(); //$this-&gt;pdf-&gt;stream($name.".pdf");
               file_put_contents("pdf/$name".".pdf", $pdf);
               $this-&gt;email-&gt;attach("pdf/$name".".pdf");
               $this-&gt;email-&gt;send();
               $this-&gt;email-&gt;clear(TRUE);
               $ecount++;
            }
        }  
  
  ?&gt;
  </code></pre>
  </blockquote>
  
  <p>------------------------this is the error i'm getting how to overcome this----------</p>
  
  <p>Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'No block-level parent found. Not good.' in /home/mycityon/public_html/navy/application/libraries/dompdf/include/inline_positioner.cls.php:38 Stack trace: #0 /home/mycityon/public_html/navy/application/libraries/dompdf/include/frame_decorator.cls.php(546): Inline_Positioner->position() #1 /home/mycityon/public_html/navy/application/libraries/dompdf/include/inline_frame_reflower.cls.php(37): Frame_Decorator->position() #2 /home/mycityon/public_html/navy/application/libraries/dompdf/include/frame_decorator.cls.php(556): Inline_Frame_Reflower->reflow(NULL) #3 /home/mycityon/public_html/navy/application/libraries/dompdf/include/page_frame_reflower.cls.php(138): Frame_Decorator->reflow() #4 /home/mycityon/public_html/navy/application/libraries/dompdf/include/frame_decorator.cls.php(556): Page_Frame_Reflower->reflow(NULL) #5 /home/mycityon/public_html/navy/application/libraries/dompdf/include/dompdf.cls.php(817): Frame_Decorator->reflow() #6 /home/mycityon/public_ in /home/mycityon/public_html/navy/application/libraries/dompdf/include/inline_positioner.cls.php on line 38</p>