title: Mail Function displaying HTML as Text
body: <p>I have the following mail function:</p>
  
  <pre><code>&lt;?php
  {
  $to = "alee@####.com";
  $subject = "General Contact.";
  $headers  = "From: ####&lt;noreply@####.com&gt;\r\n";
  $headers .= "Reply-To: info@####.com\r\n";
  $headers .= "Return-Path: info@####.com\r\n";
  $headers .= 'MIME-Version: 1.0' . "\n";
  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  $name = filter_input(INPUT_POST, 'name');
  $telephone = filter_input(INPUT_POST, 'phone');
  $nature = filter_input(INPUT_POST, 'nature');   
  $comments = filter_input(INPUT_POST, 'comments');
  $message = 
  "&lt;span style='font-weight: bold;'&gt;Name: &lt;/span&gt;"."&lt;br /&gt;".$name."&lt;br /&gt;"."&lt;br /&gt;".
  "&lt;span style='font-weight: bold;'&gt;Telephone: &lt;/span&gt;"."&lt;br /&gt;".$telephone."&lt;br /&gt;"."&lt;br   /&gt;".
  "&lt;span style='font-weight: bold;'&gt;Nature of enquiry: &lt;/span&gt;"."&lt;br /&gt;".$nature."&lt;br /&gt;"."&lt;br /&gt;".
  "&lt;span style='font-weight: bold;'&gt;Comments: &lt;/span&gt;"."&lt;br /&gt;".$comments."&lt;br /&gt;"."&lt;br /&gt;";
  
  mail($to, $subject,"We have received a message via the online form at www.####.com&lt;br /&gt;  &lt;br /&gt;" . $message, $headers);
  echo "Your message was successfully sent. Please &lt;a href='contact.php'&gt;click here&lt;/a&gt; to return to the site.";
  ?&gt;
  &lt;?php  }
  ?&gt;
  </code></pre>
  
  <p>The problem I have is that when the form is used and the message hits my inbox, the HTML is being displayed as plain text, and not being displayed properly. So I can see all the inline HTML element, i.e. the <br /> will be shown as part of the paragraph and not display a new line. Any help would be awesome!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <pre><code>Reply-To: info@###.com
  Return-Path: info@###.com
  MIME-Version: 1.0
  Content-type: text/html; charset: utf8
  
  We have received a message via the online form at www.###.com&lt;br /&gt;&lt;br /&gt;&lt;span    style='font-weight: bold;'&gt;Name: &lt;/span&gt;&lt;br /&gt;Aaron Lee&lt;br /&gt;&lt;br /&gt;&lt;span style='font-weight:   bold;'&gt;Telephone: &lt;/span&gt;&lt;br /&gt;#####&lt;br /&gt;&lt;br /&gt;&lt;span style='font-weight:   bold;'&gt;Nature of enquiry: &lt;/span&gt;&lt;br /&gt;###&lt;br /&gt;&lt;br /&gt;&lt;span style='font-weight:   bold;'&gt;Comments: &lt;/span&gt;&lt;br /&gt;Testttttttttttt&lt;br /&gt;&lt;br /&gt;
  </code></pre>