How to send mail in your local dev environment

Learn how to use Papercut software to test email sending when developing your site locally

If you develop or administer websites and you work locally (understanding with WAMP / MAMP, EasyPhp, …), you have certainly already been confronted with this problem: your site or your application cannot send an email. Which is annoying since you would need to check that the content of the messages corresponds to what you expect.

One of the solutions to solve this problem is to manually configure your computer so that it is able to communicate with an SMTP server (traditionally that of your Internet service provider). But it can be a bit tedious, especially if your technical knowledge is limited.

The other possibility, much simpler and more flexible, is to use software dedicated to this task. There are several: smtp4dev, MailDev, Fake Sendmail, … but today we are going to talk about the one I prefer: Papercut.

Papercut permet de tester l'envoi de mail en local
Papercut intercepts sent messages and displays them in a “webmail” interface

The principle of Papercut is simple: it will “monitor” the port on which the e-mails are sent (by default port 25 but you can modify this value in the options) and “catch” all the messages which pass through it.

THen if we have a look on its interface we see that Papercut simulates an email client (like Outlook or GMail). You will therefore find in the left column a list of messages received and in the right part a consultation pane which will allow you to find the details of the message (sender, title, content, …). Those looking for more technical data (such as headers or HTML code) can find it in the different tabs.

Papercut does not require any installation, just unzip the archive and double-click on papercut.exe to launch it. And to download it it happens on its Github project page.

Do not hesitate to leave a comment to share your feedback on Papercut.

Leave a Reply

Your email address will not be published. Required fields are marked *