Skip to main content

Nodemailer to a local inbox, no real email sent

Point a Nodemailer SMTP transport at Buggregator: host 127.0.0.1, port 1025, secure: false. Every message your Node.js app sends shows up in the Buggregator UI with the HTML preview and attachments, and no real email is sent.

Steps

1. Start Buggregator

Install the binary and run it. It is one file with no dependencies. The SMTP server starts on port 1025, the web UI on port 8000.

bash
curl -fsSL https://raw.githubusercontent.com/buggregator/server/master/scripts/install.sh | sh
buggregator

If ~/.local/bin is not in your PATH, run ~/.local/bin/buggregator. Prefer containers? Use Docker or Docker Compose, as shown on Getting Started.

2. Create the transport

Use this transport in development. No authentication is needed and there is no TLS to configure.

js
const transporter = nodemailer.createTransport({
    host: '127.0.0.1',
    port: 1025,
    secure: false,
});

If your app runs in Docker Compose, replace 127.0.0.1 with the Buggregator service name, for example buggregator.

3. Send a message as usual

Your code that sends mail through transporter stays the same. Trigger an email from your app: a sign-up, a reset link, a report.

4. Open the inbox

Open http://127.0.0.1:8000. Each message shows the rendered HTML with a desktop/mobile switcher, the plain text version, From, To, CC, BCC and Reply-To, the attachments and the raw MIME source.

Why it works

Buggregator includes a fake SMTP server. Nodemailer talks to it like to any mail server, but Buggregator stores the email and shows it in the UI instead of delivering it. Any app that can send email over SMTP works the same way, so your Node, PHP, Python and Ruby apps can share one inbox.

Checked on with Buggregator v2.8.0

Setup in 60 seconds

No registration. No account. Start it and point your app at it.

1

Start Buggregator

One file, installed with one command. The web UI opens on port 8000. Prefer containers? Use the Docker tab.

$ curl -fsSL https://raw.githubusercontent.com/buggregator/server/master/scripts/install.sh | sh
$ HTTP_ADDR=127.0.0.1:8000 \
  SMTP_ADDR=127.0.0.1:1025 \
  VAR_DUMPER_ADDR=127.0.0.1:9912 \
  MONOLOG_ADDR=127.0.0.1:9913 \
  PROXY_ADDR=127.0.0.1:8080 \
  ~/.local/bin/buggregator

The script picks the file for your CPU: Intel/AMD or ARM.

One file for Linux, macOS and Windows, about 40 MB. Nothing else to install.

This run line keeps it on this computer. Without the *_ADDR settings it listens on all network interfaces →

Rather not run a script? Download the file yourself →

Runs on Windows, macOS and Linux, on Intel/AMD and ARM.

Prefer not to do it yourself? Your AI agent can set Buggregator up for you →