I am trying to attach a .eml file to my email that I am sending in PHPMailer. I am doing this right now:
$mail->addStringAttachment("/var/www/virtual/xxx.xxx.com/html/test_sample_message.eml", 'test.eml', 'base64', 'message/rfc822');
It does attach a .eml file, but it’s always empty. Also, I tried doing this:
$mail->addStringAttachment($body, 'test.eml', 'base64', 'message/rfc822');
Same result if I do that (the email file is attached, but it’s empty).
What am I doing wrong here? Thanks.
Advertisement
Answer
This did the trick:
$mail->addStringAttachment($body, 'Original Email.eml', 'base64', 'application/octet-stream');