Tuesday, May 17, 2011

How to test mail delivery during development without a real SMTP server

Ever wanted an easy way to test how mails look like when sent from your application without using a real SMTP server?

Using a real server might possible include setting up security, you never know if your mails are stuck in spam filters and you are always scared that you sent it to real people by accident. Windows 7 for example does not include a SMTP service.

The answer is smtp4dev. This is a lightweight service that sits in the system tray and catches all mail sent to localhost without delivering them. The received messages can quickly be viewed and inspected.