title: drupal Webform HTML Email hooks
body: <p>I'm trying to send a thank you email to the user submitting the form in HTML.
  I found out by using a hook in my template.php file like this works to set the header correctly:</p>
  
  <pre><code>function mythemename_webform_mail_headers($form_values, $node, $sid) {
    $headers = array(
      'Content-Type'  =&gt; 'text/html; charset=UTF-8; format=flowed; delsp=yes',
      'X-Mailer'      =&gt; 'Drupal Webform (PHP/'. phpversion() .')',
    );
  
    return $headers;
  } 
  </code></pre>
  
  <p>This works freat for the "Thank You" email.
  The email that the site admin gets with the form results is also html, but it's not converting newlines to breaks in this email. I can't figure out how to use a hook for this, so I had to edit the webform.module file and do this:</p>
  
  <pre><code>function webform_mail($key, &amp;$message, $params) {
    $message['headers'] = array_merge($message['headers'], $params['headers']);
    $message['subject'] = $params['subject'];
    //$message['body'][] = drupal_wrap_mail($params['message']); // replaced this with line below
    $message['body'][] = nl2br(drupal_wrap_mail($params['message']));
  }
  </code></pre>
  
  <p>Can this be done with a hook in template.php?</p>