<div dir="ltr">There's a patch here that's not had much attention for over a year but would provide better support in core: <a href="http://drupal.org/node/28604">http://drupal.org/node/28604</a><br><br>You should also look at <a href="http://drupal.org/project/mimemail">http://drupal.org/project/mimemail</a><br>
<br>Nat<br><br><div class="gmail_quote">On Wed, Jul 16, 2008 at 10:22 AM, Omar Abdel-Wahab wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
+1<br>
<br>
I strongly would love to have D7 send HTML e-mails.<br>
<br>
At least 20 modules will benefit from this step.<br><font color="#888888">
<br>
Omar</font><div><div></div><div class="Wj3C7c"><br>
<br>
Matt Connolly wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I haven't looked at drupal 7 yet, so I'm throwing this out there for discussion.<br>
<br>
The D6 mail api seems like it's pretty much designed for plain text emails, however, a module's implementation of hook_mail can clearly set the headers of the mail to "Content-Type: text/html; charset=utf-8" and send rich text.<br>
<br>
For example, I'm looking at using "forward" module for the "email this page" link on a node, and the "simplenews" module, which uses "mimemail" to send rich emails, including attachments. Both "forward" and "mimemail" modules create a html header.<br>
<br>
The problem occurs when a module implements "drupal_mail_wrapper()" to build a html header when hook_mail has already done that - you can easily end up with bodies like:<br>
<br>
<!doctype... <-- from drupal_mail_wrapper()<br>
<html><br>
<head>...</head><br>
<body><div....<br>
<!doctype. <-- from hook_mail()<br>
<html><br>
<head> ... etc.<br>
<br>
<br>
Because there are two opportunities to create the html "head" for the message: in hook_mail and drupal_mail_wrapper.<br>
<br>
I'm throwing this out there for discussion, I think that the hook_mail should construct the message in a similar fashion to the Form API, specifying a theme for rendering the body part of the message (ie what goes in the <body> tag) and anything special that needs to go in the head as attributes.<br>
<br>
That way the message can be constructed only once.<br>
<br>
Besides, email clients have been HTML friendly for a *long* time, so I don't see why Drupal shouldn't have an interface that understands rich email messages.<br>
<br>
Thoughts?<br>
<br>
<br>
Matt<br>
<br>
<br>
</blockquote>
</div></div></blockquote></div><br></div>