Sending HTML Emails from a Drupal 7 Site

It was a little more difficult than I’d hoped to track down the proper method for sending HTML emails from Drupal 7. I’m working on a problem with Webform, so Webform emails were my primary concern. I’m not going to spend any time explaining the solution. I encourage you to look into the modules if you’re interested in learning more.

  1. Download and enable mailsystem
  2. Download and enable htmlmail
  3. Visit /admin/config/system/mailsystem
  4. Choose “HTMLMailSystem” as the mail class for all applicable “modules”
    1. To add a module (e.g., Webform), open the “New Setting” at the bottom and choose:
      1. Module = Webform
      2. Key = leave blank
    2. Save settings
    3. Update that module to use the HTMLMailSystem
  5. Try it out.

Just a quick note about Webform: It seemed like it didn’t matter if I checked (or didn’t check) the “Send e-mail as HTML” in the webform node’s email settings. Either way I ended up with HTML emails. Also, without specifying the webform module in the Mail System settings, I still got HTML emails. I’ll let you figure out what’s what. Leave me a comment if you can explain.


Leave a Reply

Your email address will not be published.