Quickstart — Send email in 5 minutes

Get from zero to sending your first email in under 5 minutes using the MailSetu API.

Step 1 — Create your account

Go to mailssetu.in/signup and create a free account. No credit card required. We automatically create a sandbox TEST key for you.

Step 2 — Get your API key

In the dashboard, go to API Keys. Copy your ms_test_ key. This is a sandbox key — MailSetu records the send in logs and previews, but it does not deliver to a real inbox or call AWS SES.

bash
MAILSETU_API_KEY=ms_test_your_key_here

Step 3 — Install the SDK

Install the official Node.js SDK:

bash
npm install mailsetu
# or: yarn add mailsetu
# or: pnpm add mailsetu

Step 4 — Send your first email

Create a file called send.ts and paste this:

typescript
import MailSetu from 'mailsetu'

const client = new MailSetu(process.env.MAILSETU_API_KEY!)

const response = await client.emails.send({
  from: 'test@example.com',      // any from address works in sandbox
  to: ['qa@example.com'],         // safe test address for log validation
  subject: 'Hello from MailSetu!',
  html: '<h1>It works! 🎉</h1><p>Your first email via MailSetu.</p>',
})

console.log(response)
// { id: 'email-xxxx', status: 'delivered', sandbox: true }

Step 5 — Go live

When you are ready for production: 1. Add and verify your real domain in the dashboard (Domains → Add domain) 2. Create a LIVE key (ms_live_) in API Keys 3. Update your environment variable 4. Use your verified domain in the from address