I'm using Phpmailer to do email sending but I'd like to know why when I try to create a PDF attachment the file does not open right, with the sending is everything normal, until the pdf is generated, but it does not open. this function below that I'm trying to make funcinar.
$mail->addStringAttachment(file_get_contents('teste.php'), 'myfile.pdf');