New: the MailCraft MCP server is live — connect your AI agent in one line. Connect your agent →
SDKs

Node.js

Send email from Node.js and TypeScript with the official MailCraft SDK.

Install

npm install @mailcraft/node

Send email

Send from a verified sender on one of your domains.

index.ts
import { MailCraft } from '@mailcraft/node';

const mailcraft = new MailCraft(process.env.MAILCRAFT_API_KEY!);

await mailcraft.emails.send({
  from: '[email protected]',
  to: ['[email protected]'],
  subject: 'Welcome!',
  html: '<p>Thanks for signing up.</p>',
});

Keep your API key in the MAILCRAFT_API_KEY environment variable, never in source control. Create one under Settings → API keys, scoped to just what this app needs.

Next steps