title: use variable's content as attachment in PHPMailer
body: <p>I want to do this:</p>
  
  <pre><code>$mail = new PHPMailer;
  $mail-&gt;AddAttachment('text in file', 'file.txt');
  </code></pre>
  
  <p>so the attachment can have dynamic content. I can only use real file as attachment now. Obviously, real file is static, I want to generate some content dynamically and attach it to the mail. There must be some way to do it, I guess it's not that obscure feature. Someone knows how?</p>