Php attachment from string
问题 I have a script generating .pdf file. This script return this file as string and then I can save it with file_put_contents() $output = $dompdf->output(); file_put_contents("myfile.pdf", $output); I want to add this file as attachment to my email using PHPMailer. If I have a file on disk I just write path to it and new name: $mail->addAttachment('/path/to/file.pdf', 'newname.pdf'); But can I add attachment without saving myfile.pdf to disk? Something like that: $mail->addAttachment($output,