title: php mail() html - sending as plain text
body: <p>Folks,</p>
  
  <p>I have sent many emails over the years with PHP and never had an HTML problem.
  I launched a new Apache/PHP server the other day and emails send fine.</p>
  
  <p>All emails send as plain text.    Seems like the encoding isn't working.</p>
  
  <p>Even with the:   </p>
  
  <pre><code>$headers .= 'MIME-Version: 1.0' . "\r\n";
  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  </code></pre>
  
  <p>Being set... the email sending is not HTML, but plain text.</p>
  
  <p>I can take this same PHP script and run it on another server and I get an HTML email.</p>
  
  <p>So I know my PHP script is correct.   What server setting in PHP/Apache would cause all emails to be sent as plain text ?</p>
  
  <p>Here is what the recipient receives on their end in the message area of the text email:</p>
  
  <pre><code>Content-type: text/html; charset=iso-8859-1
  
  From: no-reply@yahoo.com
  Message-Id: &lt;20180909154528.C4128612EC@ww1.localdomain&gt;
  Date: Sun,  9 Sep 2018 11:45:28 -0400 (EDT)
  
  &lt;html&gt;&lt;body&gt;&lt;h1&gt;Hello, World!&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>My script code:<br>
      
  
  <pre><code>$to = 'test99@domain.com';
  $subject = 'php test';
  
  $from='no-reply@yahoo.com';
  
  $headers ='';
  $headers .= 'MIME-Version: 1.0' . "\r\n";
  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  $headers .= 'From: '.$from.' '. "\r\n";
  
  $message = '&lt;html&gt;&lt;body&gt;';
  $message .= '&lt;h1&gt;Hello, World!&lt;/h1&gt;';
  $message .= '&lt;/body&gt;&lt;/html&gt;';
  
  mail($to, $subject, $message, $headers);
  </code></pre>