Skip to content
Fake SMTP server for developers - Catches emails sent via SMTP an puts them in a temp directory so you don't send people emails by accident
C# TypeScript CSS PowerShell Other
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.deploy add test sender to the dist folder, moved worker to sub folder Oct 28, 2019
.github/workflows Update dotnetcore.yml Dec 15, 2019
SMTP.Impostor.Stores.FileSystem fix(worker): reduce debounce on settings save, too long may mean its … Dec 13, 2019
SMTP.Impostor.Test.Sender fix(package): more icons Jan 4, 2020
SMTP.Impostor.Test wip(ui): allow stop of the worker service from ui Dec 1, 2019
SMTP.Impostor.Worker fix(package): more icons Jan 4, 2020
.gitignore fix(package): more icons Jan 4, 2020 docs(ui): animated png Dec 14, 2019
package-lock.json refactor(deploy): update powershell scripts to be more modular Oct 14, 2019
ui-screenshot.png docs(ui): smaller image Dec 14, 2019
ui-video.png docs(ui): video bit bigger Dec 14, 2019

SMTP Impostor Icon

smtp-impostor v3.0

Fake SMTP server for developers - Catches emails sent via SMTP an puts them in a temp directory so you don't send people emails by accident

in development, but works now

worker written in c# dotnet core 3, the ui (wip) will need npm to build

available scripts /.deploy

  1. /.deploy/build.ps1 builds worker project and publishes to /dist.
    • Run the SMTP.Impostor.Worker.exe to run as a console
  2. /.deploy/install.ps1 builds and installs as windows service
    • requires admin elevation and request user to run service as
  3. /.deploy/uninstall.ps1 uninstalls the installed service
    • requires admin elevation

{id}.eml files are dropped in {Drive}\Users\{User}\AppData\Local\Temp\Impostor\, windows 10 mail app can open them, otherwise you will need thunderbird or outlook desktop

once running the admin ui (wip) is available through a browser https://localhost:62525, you can install it as a web app if you are using a browser that supports progressive web apps (pwa)

SMTP Impostor UI

SMTP Impostor UI

using in unit tests

public void catch_emails_with_impostor()

  var hostSettings = new SMTPImpostorHostSettings(
            ip: "",
            port: 52525);

  SMTPImpostorMessage messages = null;

  using var host = GetSMTPImpostorHost(hostSettings);
  using var events = host.Events
          .Subscribe(e => message = e.Data);

  using var client = new SmtpClient(hostSettings.HostName, hostSettings.Port);
  using var mailMessage = new MailMessage
      From = new MailAddress(""),
      Subject = "SUBJECT",


  Assert.AreNotEqual(0, message.Headers);

ISMTPImpostorHost GetSMTPImpostorHost(
    SMTPImpostorHostSettings hostSettings)
    var services = new ServiceCollection()

    var hostProvider = services.GetRequiredService<ISMTPImpostorHostProvider>();
    var host = hostProvider.CreateHost(hostSettings);

    return host;
You can’t perform that action at this time.