Hello,

Is it possible to include HTML in the Registration and Forgotten Password e-mails that go out to users? I'm reluctant to experiment on my own in case it doesn't work out and my new users get some ugly e-mails. No biggie, but I thought I'd ask anyway since I couldn't find anything about it after searching.

Thanks,

Keith

Comments

ktonini’s picture

Well i tried a simple img embedding, and it didn't work. Anyone have a workaround or know what to modify in the code? This seems like it should be an important feature for any site to be taken seriously.

ktonini’s picture

After some poking around in the user.module, i found this code -

    return mail(
      $mail,
      mime_header_encode($subject),
      str_replace("\r", '', $message),
      "MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8; format=flowed\nContent-transfer-encoding: 8Bit\n" . $header
    );
  }

I think it has something to do with the Content-Type, but i'm not sure if just switching that to HTML will work or break anything. Any ideas?

Tazzed’s picture

If you edit the user.modules file to read
"MIME-Version: 1.0\nContent-Type: text/html; charset=UTF-8; ..."
This should be around line 409, it will allow you to include HTML in your automated email responses.

ryaker’s picture

How do we get the drupal community to make this change in the core drupal code so we don't have to make it as a local mod.
It seems like many many sites would like to be able to send nicely formatted html emails with graphics, etc.. so that even the registration email can retain brand identity.

--
Richard Yaker
ryaker@bejane.com
Director, Web/eCommunity Services
Be Jane, Inc.
Empowering Home Improvement
www.BeJane.com
Burbank, CA 91502
Office: 818/260-9656
Cell: (310) 279-2066