How to develop and test an app that sends emails (without filling someone's mailbox with test data)?

Patrick McElhaney picture Patrick McElhaney · Jun 17, 2009 · Viewed 45k times · Source

I have a lot of apps that send email. Sometimes it's one or two messages at a time. Sometimes it's thousands of messages.

In development, I usually test by substituting my own address for any recipient addresses. I'm sure that's what everybody else does, until they get fed up with it and find a better solution.

I was thinking about creating a dummy SMTP server that just catches the messages and dumps them in a SQLLite database, or an mbox file, or whatever.

But surely such a tool already exists? How do you test sending email?

Answer

rnwood picture rnwood · Jun 18, 2009

I faced the same problem a few weeks ago and wrote this: http://smtp4dev.codeplex.com

Windows 7/Vista/XP/2003/2010 compatible dummy SMTP server. Sits in the system tray and does not deliver the received messages. The received messages can be quickly viewed, saved and the source/structure inspected. Useful for testing/debugging software that generates email.