Watch Aspire live streamsDocsTry Aspire

Get started with Papercut SMTP integration

⭐ Community Toolkit Papercut SMTP logo

Papercut SMTP captures email sent by an application and provides a web console for inspecting messages. Use the Community Toolkit integration to run it alongside your app during development and testing.

  • An Aspire AppHost project
  • An application that can send mail through an SMTP server

Install the 📦 CommunityToolkit.Aspire.Hosting.PapercutSmtp package in the AppHost:

Terminal
aspire add CommunityToolkit.Aspire.Hosting.PapercutSmtp

Add the resource and reference it from the application that sends email. See Set up Papercut SMTP in the AppHost for port configuration and connection details.

apphost.mts
import { createBuilder } from './.aspire/modules/aspire.mjs';
const builder = await createBuilder();
const papercut = await builder.addPapercutSmtp('papercut');
const mailer = await builder.addProject('mailer', '../Mailer/Mailer.csproj');
await mailer.withReference(papercut);
await mailer.waitFor(papercut);
await builder.build().run();