Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>i know this may be late, but it may help others. Its better to use drupal_mail and then set the headers in hook_mail instead of hook_mail alter. an example would be like:</p> <pre><code>/*drupal_mail($module, $key, $to, $language, $params = array(), $from = NULL, $send = TRUE) Lets say we call drupal_mail from somewhere in our code*/ $params = array( 'subject' =&gt; t('Client Requests Quote'), 'body' =&gt; t("Body of the email goes here"), ); drupal_mail("samplemail", "samplemail_html_mail", "admin@mysite.com", language_default(), $params, "admin@mysite.com"); /*We now setup our mail format, etc in hook mail*/ function hook_mail($key, &amp;$message, $params) { case 'samplemail_html_mail': /* * Emails with this key will be HTML emails, * we therefore cannot use drupal default headers, but set our own headers */ /* * $vars required even if not used to get $language in there since t takes in: t($string, $args = array(), $langcode = NULL) */ $message['subject'] = t($params['subject'], $var, $language-&gt;language); /* the email body is here, inside the $message array */ $body = "&lt;html&gt;&lt;body&gt; &lt;h2&gt;HTML Email Sample with Drupal&lt;/h2&gt; &lt;hr /&gt;&lt;br /&gt;&lt;br /&gt; {$params['body']} &lt;/body&gt;&lt;/html&gt;"; $message['body'][] = $body; $message['headers']['Content-Type'] = 'text/html; charset=UTF-8; format=flowed'; break; } </code></pre> <p>If this is unclear to you, a complete tutorial on this can be found on <a href="http://blog.joshuakissoon.com/tutorials/sending-html-and-plain-text-mail-drupal-6" rel="nofollow">My Blog</a></p> <p>Hope this helps<br /> JK</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload