Send transactional emails from your Express.js API using Unosend. Simple REST API integration with middleware support for authentication and rate limiting.
Everything you need to send emails from Express.js
Simple REST API integration
Express middleware compatible
TypeScript and JavaScript support
Error handling middleware
Rate limiting built-in
Get up and running in minutes with this code example
// routes/email.js
const express = require('express');
const router = express.Router();
const UNOSEND_API_KEY = process.env.UNOSEND_API_KEY;
router.post('/send', async (req, res) => {
try {
const response = await fetch('https://api.unosend.co/v1/emails', {
method: 'POST',
headers: {
'Authorization': `Bearer ${UNOSEND_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
from: 'hello@yourdomain.com',
to: req.body.to,
subject: req.body.subject,
html: req.body.html,
}),
});
const data = await response.json();
res.json({ success: true, data });
} catch (error) {
res.status(500).json({ error: error.message });
}
});
module.exports = router;Follow these steps to integrate Unosend with Express.js
Install node-fetch if on older Node.js: npm install node-fetch
Add UNOSEND_API_KEY to your .env file
Create an email route or utility module
Use fetch or axios to call the Unosend API
Add error handling and rate limiting middleware
No SDK needed — just REST API calls
Works with any Node.js version
Easy to add to existing Express apps
Full control over email sending logic
More framework integrations you might like
Send transactional emails from your Next.js application using Unosend. Works with App Router, API routes, and Server Actions.
Build beautiful email templates with React components and send them with Unosend. Use JSX to create responsive HTML emails.
Send emails from Node.js with our official SDK. Support for Express, Fastify, NestJS, and any Node.js application.
Start sending emails from Express.js in under 5 minutes. Free tier includes 5,000 emails/month.