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 want to make sure that my code is correct. So I want to be able to check that the email is placed in a queue folder for example.
Can anybody recommend a SMTP server which is easy to configure?
There's also Papercut which is an SMTP server which will receive messages but not deliver them anywhere (allowing you to make sure they are being sent correctly). The received messages are visible in a small GUI and are also written to a directory.
In .NET, SmtpClient can be configured to send email by placing it in a pickup directory.
The default constructor of SmtpClient takes its settings from app.config, so for a test environment we can configure it as follows.
<configuration>
<system.net>
<mailSettings>
<smtp deliveryMethod="specifiedPickupDirectory">
<specifiedPickupDirectory pickupDirectoryLocation="path to a directory" />
</smtp>
</mailSettings>
</system.net>
</configuration>
MSDN reference - app.config mailSettings element http://msdn.microsoft.com/en-us/library/w355a94k.aspx
The smtp4dev project is another dummy SMTP server. I like it because it has a nice, simple UI that logs the messages and lets you view the contents of recent messages. Written in C# with an MSI installer. Source code is available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With