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.
- Download and enable mailsystem
- Download and enable htmlmail
- Visit /admin/config/system/mailsystem
- Choose “HTMLMailSystem” as the mail class for all applicable “modules”
- To add a module (e.g., Webform), open the “New Setting” at the bottom and choose:
- Module = Webform
- Key = leave blank
- Save settings
- Update that module to use the HTMLMailSystem
- To add a module (e.g., Webform), open the “New Setting” at the bottom and choose:
- 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.