salve!
ho integrato TCPDF in codeigniter, e risco a creare i file pdf.
solo che vorrei che il file fosse direttamente allegato alla email.
nel controller ho fatto così:
Codice PHP:
            $titolo 'Prova';
            
$pdf = new Pdf(PDF_PAGE_ORIENTATIONPDF_UNITPDF_PAGE_FORMATtrue'UTF-8'false);
            
$pdf->SetCreator(PDF_CREATOR);
            
$pdf->SetTitle($titolo);
            
$pdf->SetHeaderData(PDF_HEADER_LOGOPDF_HEADER_LOGO_WIDTH$titolo);
            
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN''PDF_FONT_SIZE_MAIN));
            
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA''PDF_FONT_SIZE_DATA));
            
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
            
$pdf->SetMargins(PDF_MARGIN_LEFTPDF_MARGIN_TOPPDF_MARGIN_RIGHT);
            
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
            
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
            
$pdf->SetAutoPageBreak(TRUEPDF_MARGIN_BOTTOM);
            
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
            
$pdf->SetFont('dejavusans'''10);
            
$pdf->AddPage();
            
$pdf->Write(5'Ciao');
            
$pdf->lastPage();
            
$attach $pdf->Output($titolo '.pdf''E');

            
$messaggio 'Ciao';
            
$this->email_model->sendEmail(emailProva$messaggiochunk_split($attach)); 
questo invece la classe che invia l'email:
Codice PHP:
<?php

class Email_model extends CI_Model {

    public function 
sendEmail($to$subject$message$attach NULL) {
        
$this->load->library('email');
        
$this->email->initialize(array(
            
'mailtype' => 'html',
            
'charset' => 'utf-8'
        
));
        
$this->email->from(emailDA ME);
        
$this->email->to($to);
        
$this->email->subject($subject);
        
$this->email->message($message);
        
$this->email->attach($attach);
        
$this->email->send();
    }

}
se non metto l'allegato l'email arriva con il testo.
se invece gli passo l'allegato l'email arriva, ma senza ne testo ne allegato.
secondo voi è possibile fare quello che sto cercando di fare?