I clearly state the problem: My .php file does two things: 1) Create a pdf (already verified, which is stored in the variable $ pdf ) and 2) Send an email using phpMailer.
The problem ?: The file $ pdf I can not send it with $mail->AddAttachment
, since $ pdf has not had its encode. For which I did the following:
$pdfdoc = $pdf->Output("", "S");
$pdflisto = chunk_split(base64_encode($pdfdoc));
By having a "supposed" $ pdflisto I try to send it by:
$mail->AddAttachment($pdflisto, "Cliente.pdf");
But, despite the arrival of the email, the attachment does not arrive.
What do I need to know or what do I need help with?
What error am I committing, either in the encode or the addAttachment , which through phpMailer does not arrive with the attachment?