Node.js
Send with Node.js.
Pass your API key and send. Nothing to install — from, to, subject, HTML, and you are done.
The first-party kit for this language is written and tested, but it is not on npm yet — so the code below uses the REST API, which works today.
Get started- Create a free account and an API key in the dashboard.
- Verify the domain you want to send from.
- Paste the call below. Node 18 and newer have
fetchbuilt in, so there is nothing to add.
1const res = await fetch("https://api.mittera.eu/api/emails", {2 method: "POST",3 headers: {4 Authorization: "Bearer mt_xxxxxxxxx",5 "Content-Type": "application/json",6 },7 body: JSON.stringify({8 from: "hello@acme.com",9 to: "you@acme.com",10 subject: "Hello from mittera",11 html: "<strong>it arrived.</strong>",12 }),13});1415const { id } = await res.json();A first-party kit is coming
It is written and tested, and it wraps exactly the call above. It is not on npm yet, so we are not going to tell you to install it. This page changes the day it is published.
const { data, error } = await mittera.emails.send({
from: "hello@acme.com",
to: "you@acme.com",
subject: "Hello from mittera",
html: "<strong>it arrived.</strong>",
});