Skip to main content

Documentation

Learn how to integrate Mailcraft into your application and start sending emails in minutes.

Quick Start

Get up and running with Mailcraft in just a few lines of code.

1. Install the SDK

terminal
npm install mailcraft
# or
yarn add mailcraft
# or
pnpm add mailcraft

2. Send your first email

send.ts
import { Mailcraft } from 'mailcraft';

const mailcraft = new Mailcraft(process.env.MAILCRAFT_API_KEY);

const { data, error } = await mailcraft.emails.send({
  from: 'Acme <hello@acme.com>',
  to: ['user@example.com'],
  subject: 'Hello from Mailcraft!',
  html: '<p>Welcome to our platform!</p>',
});

if (error) {
  console.error(error);
  return;
}

console.log('Email sent:', data.id);

Tip: Store your API key in environment variables for security. Never commit API keys to your repository.

Installation

Mailcraft SDKs are available for multiple languages and frameworks.

Node.js

npm install mailcraft

Python

pip install mailcraft

Go

go get mailcraft