So:
// Setup mail class, recipients and body $mailer->AddAttachment(\'/home/mywebsite/public_html/file.zip\', \'file.zip\'); The AddAttachment function ha
AddStringAttachment($string,$filename,$encoding,$type)
eg
$mail = new PHPMailer(); $mail->AddStringAttachment($string,$filename,$encoding,$type);
http://phpmailer.github.io/PHPMailer/classes/PHPMailer.PHPMailer.PHPMailer.html#method_addStringAttachment