Get started / Quickstart

Docs preview. Mailtarn is in development, so names and settings may change before early access.

Quickstart

Send your first test email to Mailtarn in about five minutes.

Create an inbox

In app.mailtarn.com, open Inboxes and choose New inbox. Name it after the environment that will send to it, such as staging.

Mailtarn shows the inbox’s SMTP username and password. The password is shown only once, so copy both into your secrets manager now.

There’s no public sign-up yet. Join the waitlist and we’ll email you when accounts open.

Point your app at Mailtarn

Hostsmtp.mailtarn.com
Port587 with STARTTLS (recommended), or 465 with TLS
UsernameYour inbox’s SMTP username
PasswordYour inbox’s SMTP password

mailer.js

import nodemailer from 'nodemailer';

export const transport = nodemailer.createTransport({
  host: 'smtp.mailtarn.com',
  port: 587,            // STARTTLS. For 465, set secure: true
  secure: false,
  auth: {
    user: process.env.MAILTARN_USER,
    pass: process.env.MAILTARN_PASS,
  },
});

Use a different inbox for each environment. If one set of credentials leaks, you rotate one inbox, not all of them.

Send a test email

Trigger any email in your app: sign up a test user or request a password reset. Within a few seconds it appears in your Mailtarn inbox, where you can check the HTML, plain text, headers and attachments.

Nothing is delivered to the address in the To field.

Troubleshooting

The connection times out
Some networks block outbound port 587. Try port 465 with TLS instead.
Authentication fails
Check you’re using the inbox’s SMTP credentials, not your account login. If you rotated the password more than 24 hours ago, the old one has stopped working.
TLS or certificate errors on port 465
Port 465 expects TLS from the first byte. In Nodemailer set secure: true; most other libraries call this SSL or implicit TLS.
The password is refused on port 587
Mailtarn accepts the password only after STARTTLS. Make sure your library upgrades the connection before it logs in (in Nodemailer, don’t set ignoreTLS).
The message is rejected as too large
Each inbox has a size limit per message, attachments included: 10 MB unless it was changed. The inbox’s settings show its limit.