Debug Drupal 7 emails with Devel

Devel mail debugging

A simple way of debugging email with drush in Drupal 7 using Devel module in a few steps:

Download and install the Devel module:

drush dl devel && drush en devel -y

Add this code to settings.php:

$conf['mail_system'] = array(
  'default-system' => 'DevelMailLog',
);

Flush the site cache:

drush cc all

Send a few mails, and assuming your temp-folder is /tmp, check the /tmp/devel-mails/ folder for the content of these emails.

In Drupal 8, Lando together with Mailhog offers a great solution:
https://www.drupaleasy.com/blogs/ultimike/2018/01/testing-local-drupal-site-emails-lando-and-mailhog