I want to send the HTML email to new registered user.
I am using Drupal 6. It has facility to send the mail to new registered user but the email 开发者_JAVA技巧is in only text format.
http://drupal.org/project/htmlmail must be what you are looking for.
"This module is very simple in operation. It changes headers in all outgoing e-mail modifying e-mail sent from Drupal to be HTML with the option of header, footer and CSS."
I know this is an older thread, but I stumbled across it trying to do the same thing... I started to use http://drupal.org/project/htmlmail and realized that I didn't really need 3 modules to accomplish this... here is a quick snippet for anyone trying to accomplish this in a more lightweight way:
function mymodule_mail_alter(&$message){
$message['headers'] = array_merge(
$message['headers'],
array(
'MIME-Version' => '1.0',
'Content-Type' => 'text/html; charset=UTF-8; format=flowed',
'Content-Transfer-Encoding' => '8Bit',
'X-Mailer' => 'Drupal'
)
);
if(!is_array($message['body'])){
$message['body']=array($message['body']);
}
foreach($message['body'] as $k=>$v){
$message['body'][$k]=str_replace(array("\n","\t"),array('<br>',' '),$v);
}
}
精彩评论