The pseudoSMTP (psmtp) package provides an SMTP server for your test environment. Use psmtp to capture all outgoing mail from your application under test and validate that email through the REST API that exposes all captured messages.
Deployment and configuration of psmtp is quick and painless. By default (and design), psmtp simply accepts all incoming mail and stores it in its database for inspection and validation by your unit and/or functional tests.
More details on usage are available at the project web site: https://github.com/Slugger/pseudosmtp/