PracticalWeb Ltd

Websites that work for you.

Drupal Development Mail Testing

One of the problems I have encountered while developing for Drupal on a laptop is how to test the sending of emails.

I’ve recently come across two solutions.

Devel Module

This helpful module includes a mail wrapper function which directs all mail to the Drupal logs, perfect for testing volume mail sending or just for getting a password reset link.

SSH tunnels

This is probably a more specialist solution - but I’ve recently been using an SSH tunnel to allow me to send and receive email through a firewall. As a bonus this means that all mail on localhost port 25 is redirected to my mailserver and PHP mail functions Just Work

ssh -L 25:localhost:25