// load PHPMailer require_once('path/to/PHPMailerAutoload.php'); $mail = new PHPMailer; // add the PDF file as an attachment $pdf_content = file_get_contents('path/to/myfile.pdf'); $mail->AddStringAttachment($pdf_content, 'myfile.pdf'); // send the email $mail->send();In this example, the AddStringAttachment() method is used to attach the contents of 'myfile.pdf' as a string to the email that is being sent. Overall, PHPMailer is a powerful and flexible package for sending emails in PHP, and the AddStringAttachment() method is just one of the many useful tools it provides.