When your system has data with real email addresses and you need to test email delivery functionality... it is very dangerous to do this with real smtp server. You can substitute your real SMTP Server with Fake Smtp server and no one email message leaves your development environment.
Fake Smtp — is ASP.NET project that you can deploy to IIS or run on a local machine.
The base for this project is netDumpster library and its NuGet package, as well as the class MailMessageMimeParser of mimeparser.codeplex.com project.
When the web site starts, it creates a new smtp server (Fake Smtp server) with host name of the hosting web server. The new smtp server starts listening the port which can be configured on the setting page (5000 by default).
When a email message is sent to Fake Smtp server host and port, Fake Smtp server receives the message, keeps it in memory and sends it nowhere further.
The Fake Smtp site is a web interface for Fake Smtp server. The site allows seeing:
The setting page allows to:
var email = new System.Net.Mail.MailMessage("from@mail.com", "to1@mail.com, to2@mail.com", "Subject", "Message");
using (var smtpClient = new System.Net.Mail.SmtpClient {Host = "localhost", Port = 5000})
{
smtpClient.Send(email);
}
This project was created as part of the open source contribution program in Artezio company.