Corrupt PDF on the fly attached to email via dompdf

狂风中的少年 提交于 2020-01-17 04:31:06

问题


I'm trying to attach a PDF on the fly to send it via email, but i'm getting it corrupted when i download it from there. I also tried to put it inside a .zip, but it didn't change the status of the .pdf itself.

Here's my code:

 //email para o cliente
                $this->load->library('email');
                $config['newline'] = "\r\n";

                $this->email->from('contato@avanhandava.org', 'Avanhandava');
                $this->email->to($this->input->post('email'));

                $this->email->subject('Inscrição para o Acampô');
                $this->email->message($this->input->post('nome').','."\r\n"."\r\n".'Sua inscrição foi realizada com sucesso! Segue anexa sua Ficha de Inscrição, que deve ser impressa, assinada e entregue à Marli (XXXX-XXXX).'."\r\n".'Caso haja algum erro na ficha, basta acessar a página inicial e inserir o RG do inscrito para editá-la.'."\r\n"."\r\n".'Obrigado,'."\r\n"."\r\n".'Avanhandava');


                $this->load->helper(array('dompdf', 'file'));

                $this->load->view('ps_retorno', $preco, true);

                pdf_create(blablabla in html integrating with my db with sucess, inscricao);

                write_file('inscricao.pdf');


                $this->email->attach('inscricao.pdf');


                $this->email->send();

Any ideas?

来源:https://stackoverflow.com/questions/32875865/corrupt-pdf-on-the-fly-attached-to-email-via-dompdf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!