Prevent accidentally sending mails from your development environment

When you're, like me, using Windows as your development environment, letting your Drupal environment send mails can be a big challenge. In contrast to a Linux/Mac OS X based system, where it is much easier to send mails. I think too easy. I've lost the count how many times a colleague had sent an apology mail when he/she had accidentally sent test emails to existing email addresses, whoops! So, I do like that it's more difficult on Windows to send mails.

A solution that is often used is to install a module such as Reroute Email and configure the settings using Configuration Split. However, you are still vulnerable for easy mistakes (e.g., forgetting you have loaded the settings of the acceptance environment, which can send mails). In addition to this solution, I always have Papercut installed. Papercut acts as the (local) SMTP server, but instead of sending the mails to the provided addresses, it provides a GUI to see the contents of the mail. So, email sent from Drupal never leaves your development environment.

Category

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.