title: Drupal 7 drupal_mail stripping out HTML?
body: <p>I have a custom module that I'm trying to generate an HTML email from using the drupal_mail function (D7). Mail is coming through, and even shows text/html, however something somewhere appears to be stripping out the HTMl before it gets to an inbox. </p>
  
  <p>First, in a function I'm building my title/body/other vars and sending to a custom function:</p>
  
  <pre><code>    $body = "We thought you'd like to know that ".$fullname." has marked your project as completed.
      &lt;br /&gt;&lt;br /&gt;
      Please visit the link at &lt;a href='http://".$_SERVER['HTTP_HOST']."/survey/customer/".$customer[0]-&gt;unique_id."'&gt;http://".$_SERVER['HTTP_HOST']."/survey/customer/".$customer[0]-&gt;unique_id."&lt;/a&gt; to take the survey.";
      $returnMail = latch_send_mail('pro_realized',$customer[0]-&gt;customer_email,$user-&gt;mail,$title,$body);
  </code></pre>
  
  <p>Then I have the latch_mail latch_send_email functions:</p>
  
  <pre><code>function latch_mail($key, &amp;$message, $params) {
      $headers = array(
      'MIME-Version' =&gt; '1.0',
      'Content-Type' =&gt; 'text/html; charset=UTF-8; format=flowed',
      'Content-Transfer-Encoding' =&gt; '8Bit',
      'X-Mailer' =&gt; 'Drupal'
  );
  
  foreach ($headers as $key =&gt; $value) {
      $message['headers'][$key] = $value;
  }
  
  $message['body'][] = $params['body'];
  $message['subject'] = $params['subject'];
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>function latch_send_mail($key,$to,$from,$title,$body,$headers='') {
      $params['body']=$body;
      $params['subject'] = t($title);
      return drupal_mail('latch', $key, $to, language_default(), $params, $from,TRUE);
  }
  </code></pre>
  
  <p>I would expect the emails to come through with my a tags and br tags, but it comes through like this:</p>
  
  <pre><code>We thought you'd like to know that John Doe has marked your project as completed. Please visit the link at http://latch.local/survey/customer/34c91b8883cd70b32c65feb7adf9c393 [1] to take the survey. [1] http://latch.local/survey/customer/34c91b8883cd70b32c65feb7adf9c393
  </code></pre>
  
  <p>Somehow it's taking my links and turning them into footnotes while removing the br tags completely.</p>
  
  <p>Any help you can provide would be appreciated. Thanks!</p>