Drupal 7 drupal_mail removes HTML?

I have a custom module that I am trying to create an HTML email using the drupal_mail (D7) function. Mail goes through and even shows the text / html, however something somewhere seems to delete the HTMl before it gets to the inbox.

First, in the function, I create my header / body / other vars and send the user-defined function:

    $body = "We thought you'd like to know that ".$fullname." has marked your project as completed.
    <br /><br />
    Please visit the link at <a href='http://".$_SERVER['HTTP_HOST']."/survey/customer/".$customer[0]->unique_id."'>http://".$_SERVER['HTTP_HOST']."/survey/customer/".$customer[0]->unique_id."</a> to take the survey.";
    $returnMail = latch_send_mail('pro_realized',$customer[0]->customer_email,$user->mail,$title,$body);

Then I have the latch_mail latch_send_email functions:

function latch_mail($key, &$message, $params) {
    $headers = array(
    'MIME-Version' => '1.0',
    'Content-Type' => 'text/html; charset=UTF-8; format=flowed',
    'Content-Transfer-Encoding' => '8Bit',
    'X-Mailer' => 'Drupal'
);

foreach ($headers as $key => $value) {
    $message['headers'][$key] = $value;
}

$message['body'][] = $params['body'];
$message['subject'] = $params['subject'];
}

and

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);
}

I would expect emails to go through with my tags and br tags, but this happens as follows:

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

Somehow he takes my links and turns them into footnotes, completely removing the br tags.

Any help you can provide will be greatly appreciated. Thank!

+5
source share
2

, Drupal HTML- . , Drupal HTML-, HTML Mail. http://drupal.org/project/htmlmail , HTML- .

+4

. , Mime Mail. README.txt , . .

Mime Mail . , hook_enable hook_update_N example.install:

function example_enable() {
  mailsystem_set(array(
    'example_examplekey' => 'MimeMailSystem',
  ));
}

admin/config/system/mailsystem, , ​​ :

( )

MimeMailSystem

text/html, Mime Mail . :

$headers['Content-Type'] = ...

, $message['plaintext'] , HTML, .

!

0

All Articles