Quick Start
Send your first email in under 5 minutes.
1. Create an API Key
Go to your API Keys dashboardand click "Create API Key". Copy the key immediately — it's only shown once.
2. Send Your First Email
Use one of the examples below. Replace YOUR_API_KEY with your actual key.
send-email
const response = await fetch('https://api.mailstack.io/v1/email/send', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
to: 'recipient@example.com',
from: 'you@yourdomain.com',
subject: 'Hello from MailForge',
html: '<h1>It works!</h1><p>Your first email via MailForge.</p>',
}),
});
const data = await response.json();
console.log(data); // { id: '...', status: 'queued' }3. Verify Your Domain (Optional)
For production use, add your domain in the Domains dashboard. We'll automatically generate DKIM, SPF, and DMARC records. Add them to your DNS provider, and click "Verify".
4. Set Up Webhooks (Optional)
Track delivery events in real time. Go to Webhooksand add your endpoint URL. We'll POST events like delivered,bounced, andopened to your server.