docs

API

SMTP

Send through emitemail with any SMTP library or app.

Already sending over SMTP? Change the host and password. Nothing else in your code changes.

Host:     smtp.emitemail.com
Port:     587 (STARTTLS required)
Username: emit
Password: your emitemail API key

The username is ignored. Your API key is what identifies you. SMTP mail goes through the same checks as the API: verified domain, suppression list, monthly cap and daily limit.

import nodemailer from "nodemailer";

const transport = nodemailer.createTransport({
  host: "smtp.emitemail.com",
  port: 587,
  requireTLS: true,
  auth: { user: "emit", pass: process.env.EMIT_API_KEY },
});

await transport.sendMail({
  from: "Your Store <orders@yourstore.com>",
  to: "customer@example.com",
  subject: "Your order has shipped",
  html: "<p>On its way.</p>",
});

Refusals over SMTP#

When a send is refused, emitemail answers with an SMTP error whose text names the reason, for example that the monthly cap was reached. Your library will raise it as an exception.