title: Which kind of img data is lost when storing a file in a variable first?
body: <p>I want to send an Email with PHPMailer and use an HTML template using:</p>
  
  <pre><code>$mail-&gt;msgHTML()
  </code></pre>
  
  <p>When using:</p>
  
  <pre><code>$mail-&gt;msgHTML(file_get_contents('./contents.html'), __DIR__);
  </code></pre>
  
  <p>Everything works as expected, and the email contains the image, <strong>without</strong> attaching it.
  But if I store the file contents in a variable like so:</p>
  
  <pre><code>$body = file_get_contents('./contents.html');
  $mail-&gt;msgHTML($body);
  </code></pre>
  
  <p>the image data gets lost.
  Why is my image not included in the sent email when reading file contents into a variable first?
  -OR- What kind (part) of data is lost?
  Why do I have to send it as an Attachment to get it working?</p>
  
  <p>HTML code for reference:</p>
  
  <pre><code>&lt;td style="font-size: 12px; color:#929292; text-align:center; font-family: sans-serif;"&gt;
  &lt;img src="./logo_nav.png" alt="" sizes="" srcset=""&gt;
  &lt;/td&gt;
  </code></pre>