I'm trying to send HTML emails from a module and I'm using drupal_mail()
.
It's not possible to send HTML email with just drupal_mail()
(see here), and I've installed Mimemail. However, the email is still being stripped of all HTML tags.
Do I need to make any extra calls in the email template, or is there something else I've forgotten?
Set-Up
Mail System
- format() -- mimemail system
- mail() -- SMTP module
Mimemail
- Email Format: Filtered HTML (My filtered HTML allows
<p>
and<br>
tags. - Include all site stylesheets.
SMTP module
- Allow HTML formatted emails
drupal_mail
tellafriend_mail($key, &$message, $params) {
$message['headers']['MIME-Version'] = '1.0';
$message['headers']['Content-Type'] = 'multipart/mixed;';
$message['headers']['Content-Type'] = 'text/html;';
$message['subject'] = t('This is a test email');
$message['body'][] = t("This is a test email")."<p></p><p>".t("This should be a new paragraph.")."</p><p></p><p>".t("And a third paragraph.")."</p>";
$message['params']['attachments'] = $params;
}