Search This Blog

Wednesday, October 14, 2015

Testing email functionality in applications with smtp4dev

Testing e-mail functionality in code using external SMTP servers has always been a difficulty in terms of configuring SMTP server and maintaining it. Sometime by mistake, an email can go to a recipient who is not supposed to receive emails in testing or development phase of application.
Also, on exchange servers it will typically take few minutes before a locally sent mail actually arrives back in inbox which increase the testing time.
smtp4dev is small email server whose purpose is to help developers and testers to view sent email messages via SMTP connections. It emulates a remote SMTP server on local machine so Instead of actually sending the mail onwards like a normal SMTP server, smtp4dev simply catch the mail and notify user. This means user will receive the mail instantly without any risks of being caught in spam filters or dying of old age before receiving the mail.

smtp4dev running and listening on port 25

The received email can be opened in outlook (or any configured mail client) for viewing. Also, email can be inspected for its source, header, body and message source.
Received message in outlook


Download smtp4dev from here.

No comments:

Post a Comment