HTML markup is removed from email I am trying to send an email with a small html form of hidden fields and a submit button. I have been piecing this together from several very incomplete answers and documentation sources that take several approaches to this but no answer so far has worked for me (so please do not mark this as a duplicate).

I have a module, my_module, and in the my_module.module file I have the following hook.

function ten_sixteen_mail($key, &amp;$message, $params) {
    if (isset($params['subject'])) {
        $message['subject'] = $params['subject'];
    }
    if (isset($params['body'])) {
        $message['body'][] = $params['body'];
    }
    if (isset($params['headers']) &amp;&amp; is_array($params['headers'])) {
        $message['headers'] += $params['headers'];
    }
}


Elsewhere in my_module.module I send an email with the following code. I am getting the email, but without the form and button html, only the  text.

$to = "someone@example.com";
$subject = "This is an email subject";
$body = "&lt;p&gt;Here is some text.&lt;/p&gt;";
$body .= '&lt;form name="someform" action="https://www.example.com/somepage" method="post"&gt;';
$body .= '&lt;input type="hidden" name="somecode" value="' . $somecode . '" /&gt;';
$body .= '&lt;input type="hidden" name="something" value="' . $something . '" /&gt;';
$body .= '&lt;input type="submit" style="padding: 10px; background-color: #d42c2c; border: 2px solid #cccccc;" value="Click This" /&gt;';
$body .= '&lt;/form&gt;';
$params = array(
    'headers' =&gt; 'Content-type: text/html',
    'subject' =&gt; $subject,
    'body' =&gt; $body,
);

$message = drupal_mail("my_module", "my_module", $to, language_default(), $params, "serviceaccount@example.com");


I have Mail System and Mime Mail installed and enabled. 

I'm pretty confused about the config options for both modules. For Mail System I have set the 'theme to render the emails' to my custom theme, though I really don't require any theme-ing of the email it was not an option to disable this.

I have created a new module and key setting with the key my_module for the module my_module.

Mime Mail is set to use the Full HTML Email format.

What am I doing wrong that is preventing my html form from coming through in the email?
The hook_mail headers need to be like this:

$message['headers']['Content-Type'] = 'text/html; charset=UTF-8; format=flowed';