Bring your own provider
Plug in Resend, Brevo, or any SMTP server. A single provider interface keeps your app portable — switch providers by changing one environment variable.
Open source · MIT licensed · Vercel-ready
Mail Engine sends real welcome emails, OTPs, password resets, and order confirmations through your own Resend, Brevo, or SMTP account. No vendor lock-in. No dummy responses.
Your account is ready. Use the code below to verify your email address and finish setting up.
This code expires in 10 minutes.
Verify emailWorks with the provider you already pay for
Features
Stop rebuilding SMTP glue, email HTML, and retry logic in every project. Mail Engine gives you one clean, secure, provider-agnostic layer.
Plug in Resend, Brevo, or any SMTP server. A single provider interface keeps your app portable — switch providers by changing one environment variable.
OTP, welcome, password reset, email verification, contact confirmations, order receipts, account activity, and more — responsive, branded, and ready to send.
A Bearer-authenticated JSON API with Zod validation and clear status values, plus an official Node.js SDK so your send calls are fully type-safe.
Built for Node.js functions: no VPS, no persistent filesystem, no Docker. Every send awaits your provider and returns the real provider result.
Locked From address, HTML-escaped variables, constant-time key comparison, per-IP rate limits, and logs that never expose OTPs or tokens.
Receive delivered, bounced, and complaint events from your provider with signature verification, so you always know what actually reached the inbox.
How it works
Your application stays clean. Mail Engine handles authentication, validation, templating, and the provider hand-off.
Add your Resend, Brevo, or SMTP credentials and a verified sender address as environment variables. No SDK juggling or per-provider code.
POST a template name, recipient, and variables. Authentication, request limits, and input validation happen before anything is rendered.
Mail Engine renders a responsive template, sends it through your provider, and returns the real message ID and status — never a fake success.
Templates
Every template accepts your logo, brand color, company name, footer, support email, and website URL. User variables are escaped automatically.
One-time passwords with expiry copy and a large, scannable code block.
otpA clear, single-action reset link with safety guidance and expiry notice.
password-resetFriendly confirmation with a branded call to action and fallback URL.
email-verificationMake a strong first impression right after registration.
welcomeConfirm the account and summarize what happens next.
account-createdAlert users to new sign-ins or sensitive account changes.
account-activityAuto-reply to form submissions so nobody wonders if it sent.
contact-thank-youRoute form details to your team with the visitor's reply-to address.
contact-admin-notificationReceipt-style summary with line items, totals, and order details.
order-confirmationA flexible content template for everything else your product needs.
generic-notification
Shared variables: company_name support_email app_url logo_url brand_color year. Send your own with the REST API or Node SDK.
Developer experience
Send templated email with a short JSON request and get an honest, structured response back.
curl -X POST https://your-mail-engine.com/api/v1/emails/send \
-H "Authorization: Bearer $MAIL_ENGINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"template": "welcome",
"to": "customer@example.com",
"variables": {
"name": "John",
"company_name": "Acme Inc"
}
}'
import { MailEngineSDK } from '@mail-engine/node-sdk';
const mail = new MailEngineSDK();
const result = await mail.sendTemplated({
template: 'welcome',
to: 'customer@example.com',
variables: {
name: 'John',
company_name: 'Acme Inc',
},
});
console.log(result.status); // "accepted"
<?php
$payload = json_encode([
'template' => 'welcome',
'to' => 'customer@example.com',
'variables' => [
'name' => 'John',
'company_name' => 'Acme Inc',
],
]);
$ch = curl_init('https://your-mail-engine.com/api/v1/emails/send');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . getenv('MAIL_ENGINE_API_KEY'),
'Content-Type: application/json',
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
String json = """
{
"template": "welcome",
"to": "customer@example.com",
"variables": { "name": "John", "company_name": "Acme Inc" }
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://your-mail-engine.com/api/v1/emails/send"))
.header("Authorization", "Bearer " + System.getenv("MAIL_ENGINE_API_KEY"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
{
"success": true,
"status": "accepted",
"messageId": "r_1234567890",
"message": "Email accepted by Resend"
}
/api/health/api/v1/emails/send/api/v1/templates/api/v1/emails/test/api/v1/webhooks/provider/api/v1/usageSecurity
OTPs and password resets are a direct line into your users' accounts. Mail Engine treats them that way.
FAQ
Everything developers ask before wiring up transactional email.
Read the full documentationYes. Mail Engine is not an SMTP server and does not provide unlimited sending. You connect your own Resend, Brevo, or any SMTP account, and Mail Engine handles templates, validation, authentication, and delivery calls.
Mail Engine is MIT licensed and free for personal and commercial use. You only pay your email delivery provider for the messages you send.
Yes — it is designed for Vercel Node.js serverless functions. Import the repository, add your provider credentials and API key as environment variables, and deploy. No VPS or persistent filesystem is required.
Any language that can make an HTTP request. Official examples ship for Node.js, React + Vite, Java, PHP, and plain HTML forms, plus a type-safe Node.js SDK.
Every send endpoint requires a Bearer API key compared in constant time, the From address is locked to your verified sender, template variables are HTML-escaped, requests are rate limited, and OTPs, tokens, and API keys are never logged.
No. Ten responsive templates cover OTP verification, welcome, password reset, email verification, contact confirmations, admin notifications, order confirmations, account creation, account activity, and generic notifications.
Get started
Clone the repository, add your provider key, and deploy. Your SMTP. Your emails. One simple engine.
MIT licensed · No credit card · No lock-in