Fake Smtp is a web interface for the fake smtp server

The problem solved

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.

The project

Fake Smtp — is ASP.NET MVC 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 the 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:

  • Headers of received email messages in a table.
  • The list of email messages in a compact view, with possibility to read the email message body and download attachments.
  • Every email message in full view including raw data which was received by Fake Smtp server.

The setting page allows to:

  • See a name or address for a host of the Fake Smtp server
  • Assign a port for the Fake Smtp server to listen and receive email messages.
  • Start the Fake Smtp server with the giving port.
  • Stop the Fake Smtp server.
  • Clear (delete) early received email messages from memory of the Fake Smtp server.
  • Send test email message to the Fake Smtp server (with or without attachment).

The regular email message can be sent to the Fake Smtp server using, for instance, the following C# code. Host and Port values can be taken from the setting page:

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);
}

Web Interface screenshots

 Artezio Logo

List of email messages in compact view

Table of email message headers

Full email message

 

About Artezio

http://www.artezio.com is an ISO 9001:2008 certified software development and consulting company. Since its establishment in 2000, Artezio has completed more than 500 projects for its international clients. Since 2005, Artezio is a member and a major offshore division of LANIT group which is a $2.5B IT Services vendor with 5000 employees. From its development centers in Russia, Belarus and Ukraine Artezio delivers cost effective, high quality IT services to clients in North America, Europe, Middle East and Japan thus being one of the leading Russian offshore/nearshore software developers.

 

Last edited Oct 4, 2016 at 9:42 AM by lobodava, version 19