Skip to main content

Overview

Unosend offers a modern, developer-friendly alternative to Mailgun with transparent pricing and a simpler API surface. Why switch:
  • Predictable pricing — flat monthly plans vs Mailgun’s per-email pricing
  • Modern API — JSON-first design vs Mailgun’s form-data approach
  • Built-in features — broadcasts, SMS, WhatsApp, and validation included
  • No vendor lock-in — simple REST API compatible with any language

Migration Steps

1. Create Your Unosend Account

  1. Sign up at unosend.co/signup
  2. Add and verify your sending domain
  3. Generate an API key

2. Update Environment Variables

- MAILGUN_API_KEY=key-xxxxxxxxxxxx
- MAILGUN_DOMAIN=mg.yourdomain.com
+ UNOSEND_API_KEY=un_xxxxxxxxxxxx

3. Update Your Code

Before (Mailgun):
const Mailgun = require('mailgun.js');
const formData = require('form-data');
const mailgun = new Mailgun(formData);
const mg = mailgun.client({ username: 'api', key: process.env.MAILGUN_API_KEY });

await mg.messages.create('mg.yourdomain.com', {
  from: 'hello@yourdomain.com',
  to: ['user@example.com'],
  subject: 'Hello',
  html: '<p>Welcome!</p>'
});
After (Unosend):
import { Unosend } from 'unosend';
const unosend = new Unosend(process.env.UNOSEND_API_KEY);

await unosend.emails.send({
  from: 'hello@yourdomain.com',
  to: ['user@example.com'],
  subject: 'Hello',
  html: '<p>Welcome!</p>'
});

4. Update DNS Records

Remove Mailgun’s DNS records and add Unosend’s:
TypeNameValue
TXTunosend._domainkeyYour DKIM public key
MXsend10 mail.unosend.co
TXTsendv=spf1 include:_spf.unosend.co ~all

Key Differences

FeatureMailgunUnosend
AuthBasic Auth (api:key-xxx)Bearer token (Bearer un_xxx)
Content typemultipart/form-dataapplication/json
Domain in URLRequired (/v3/{domain}/messages)Not required
WebhooksSignature-verifiedBearer token verified
TemplatesHandlebarsMustache variables
Logs3-day retention (free)Plan-based (3–30 days)

Pricing Comparison

Emails/MonthMailgunUnosendSavings
50,000$35/mo (Foundation)$20/mo43%
100,000$75/mo$50/mo33%
500,000$350/mo$340/mo3%
1,000,000$700/mo$600/mo14%
Unosend includes broadcasts, SMS, WhatsApp, and validation — Mailgun charges extra for these.

Quick Start Guide

Get sending in under 5 minutes