I need to configure a SMTP server for testing my website which sends emails (for registration confirmation etc).
I dont actually want the email to be sent, I just w
I think the blog post A Simple SMTP Server Mock for .NET gives you what you need: a SMTP server mock
A SMTP server mock is basically a fake SMTP server which can be used for unit testing of applications which send email messages.
Also, a google search for smtp mock server will provide you with a selection of SMTP servers for testing purposes. Like:
You can use Mailnest.io as it is an affordable and yet very effective tool for email testing. It also has a free forever plan for limited usage.
Note that the SmtpClientWrapper class proposed by tvanfosson needs the all-important "virtual" keyword in its declaration of the Send method, otherwise you are back in the same boat as trying to Mock the SmtpClient directly.
As per many of the other suggestions a free tool I've used quite a lot: http://www.toolheap.com/test-mail-server-tool/
Not really for TDD but useful in manual testing as it can pop up an outlook express window with each email that would be sent.
I found this - http://improve.dk/archive/2010/07/01/papercut-vs-smtp4dev-testing-mail-sending-locally.aspx which explain how to use papercut and smtp4dev which are both good tools
If you are on Mac OS X you can use MockSMTP.app