问题描述:

Here i am generating a pdf using the code

$mpdf->Output('Maintenance_Report.pdf','D');

$mpdf->Output(FILE_PDF ."/Maintenance_Report.pdf",'F');

after that i am attach this email send to user.

After that page is not redirected to my home page.

But when iam commending "$mpdf->Output('Maintenance_Report.pdf','D');". Then redirection works.

 $this->load->library('mpdf');

$mpdf = new mPDF('utf-8','A4','','20',15,10,10,10,10,10);

$mpdf->useAdobeCJK=true;

$mpdf->SetAutoFont(AUTOFONT_ALL);

$mpdf->ignore_invalid_utf8=true;

$mpdf->AddPage('L');

$mpdf->list_indent_first_level = 0;

$mpdf->WriteHTML($PrintInst);

$mpdf->Output('Maintenance_Report.pdf','D');

$mpdf->Output(FILE_PDF ."/Maintenance_Report.pdf",'F');

$this->load->library('email');

$fromemail="[email protected]";

$toemail = $this->input->post('mail');

$subject = "Flat Maintenance Report";

$this->load->library('email');

$config=array(

'charset'=>'utf-8',

'wordwrap'=> TRUE,

'mailtype' => 'html'

);

$this->email->initialize($config);

$this->email->to($toemail);

$this->email->from($fromemail, "Flat Management");

$this->email->subject($subject );

$this->email->message($content);

$this->email->attach(FILE_PDF."/Maintenance_Report.pdf");

$mail = $this->email->send();

//header("Refresh:5;url=".base_url()."flat/dashboard");

$this->session->set_flashdata('mail', 'Your mail has been sent.');

redirect("flat/dashboard");

相关阅读:
Top