Skip to main content
Yasumu includes a built-in catch-all SMTP server that makes testing email functionality effortless. Instead of configuring external email services or dealing with spam filters, you can capture and inspect all emails sent from your application directly within Yasumu.

What is a catch-all SMTP server?

A catch-all SMTP server accepts all incoming emails regardless of the recipient address. This is perfect for testing because:

No configuration

No need to set up real email accounts or configure email providers.

Privacy

All emails stay local—no sensitive data sent to external services.

Fast

Instant email capture without network latency or rate limits.

Complete control

View, search, and delete emails at will during testing.

SMTP configuration

The SMTP server configuration is stored in yasumu/smtp.ysl:
@smtp

metadata {
  id: "fyed9v8otb9a9vedyx8wy9f6"
  port: 50611
  username: ""
  password: null
}
The SMTP server listens on this port. Yasumu automatically assigns an available port when the workspace is created.Configure your application to send emails to localhost:<port>.
Optional SMTP authentication username. Leave empty if authentication is not required.
Optional SMTP authentication password. Set to null or empty string to disable authentication.

Configuring your application

To send emails to Yasumu’s SMTP server, configure your application with these settings:
const nodemailer = require('nodemailer');

const transporter = nodemailer.createTransport({
  host: 'localhost',
  port: 50611,  // Use the port from your smtp.ysl
  secure: false,
  auth: {
    user: '',   // Leave empty if no auth
    pass: '',   // Leave empty if no auth
  },
});

// Send an email
await transporter.sendMail({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Test Email',
  text: 'Hello from my app!',
  html: '<p>Hello from my app!</p>',
});
The SMTP server automatically starts when you open a workspace in Yasumu. Make sure Yasumu is running when testing email functionality.

Managing SMTP configuration

Use the Email module API to manage SMTP settings programmatically:
import { EmailModule } from '@yasumu/core';

// Get current SMTP port
const port = await workspace.emails.getSmtpPort();
console.log('SMTP server running on port:', port);

// Get complete configuration
const config = await workspace.emails.getSmtpConfig();
console.log('SMTP config:', config);

Viewing captured emails

Access and manage captured emails through the Email module:
// Get paginated list of emails
const result = await workspace.emails.listEmails({
  page: 1,
  limit: 20,
  sortBy: 'createdAt',
  sortOrder: 'desc',
});

console.log(`Total emails: ${result.total}`);
console.log(`Page ${result.page} of ${result.totalPages}`);

result.data.forEach(email => {
  console.log(`From: ${email.from}`);
  console.log(`To: ${email.to}`);
  console.log(`Subject: ${email.subject}`);
  console.log(`Date: ${email.createdAt}`);
  console.log('---');
});

Email data structure

Captured emails contain the following information:
{
  id: string;           // Unique email identifier
  from: string;         // Sender address
  to: string[];         // Recipient addresses
  cc: string[];         // CC addresses
  bcc: string[];        // BCC addresses
  subject: string;      // Email subject
  date: string;         // Send date
  createdAt: string;    // Capture timestamp
}

Testing workflows

Here are common email testing workflows with Yasumu:
1

Start SMTP server

Open your workspace in Yasumu. The SMTP server starts automatically.
2

Configure application

Point your application’s email configuration to localhost with the port from smtp.ysl.
3

Trigger email

Perform actions in your application that trigger email sending (e.g., user registration, password reset).
4

Verify capture

Check Yasumu’s email inbox to verify the email was captured correctly.
5

Inspect content

Review the email subject, body, headers, and attachments to ensure they match expectations.
6

Clean up

Delete test emails to prepare for the next test run.

Use cases

User registration

Test welcome emails, email verification links, and onboarding sequences.

Password reset

Verify password reset emails contain correct links and security tokens.

Notifications

Test event notifications, alerts, and digest emails.

Transactional emails

Verify order confirmations, invoices, and shipping notifications.

Marketing emails

Preview newsletter layouts and test unsubscribe functionality.

Email templates

Test email templates with different data and verify rendering across clients.

Best practices

Use unique ports: If running multiple Yasumu workspaces, ensure each has a unique SMTP port to avoid conflicts.
Clear between tests: Delete old emails between test runs to avoid confusion and keep the inbox clean.
Test all recipients: Verify emails are sent to all expected recipients (to, cc, bcc).
Check both formats: Always verify both plain text and HTML email content for proper formatting.
The SMTP server is designed for local testing only. Do not expose it to external networks or use it in production environments.

Troubleshooting

  • Verify Yasumu is running and the workspace is open
  • Check your application is configured with the correct SMTP port
  • Ensure no firewall is blocking localhost connections
  • Check application logs for SMTP connection errors
If the SMTP port is occupied:
// Update to a different port
await workspace.emails.updateSmtpConfig({
  port: 2525, // Or any available port
});
If your application requires SMTP authentication:
await workspace.emails.updateSmtpConfig({
  username: 'test-user',
  password: 'test-password',
});

Next steps

REST API Testing

Test API endpoints that trigger email sending

Scripting

Automate email testing with scripts

Workspaces

Learn more about workspace structure

Environments

Configure SMTP settings per environment

Build docs developers (and LLMs) love