Skip to main content
Documentation

Send your first email

End-to-end tutorial: from account creation to confirmed delivery.

1. Create your account

Go to coffeemail.com.br/signup and create your account in under 30 seconds. You start with 3,000 free emails per month on the Free plan — no credit card.

2. Create an API Key

Go to Dashboard → API Keys → New key. Give it a descriptive name (e.g. 'Production', 'Staging') and copy the token — it is only shown once.

3. Add a domain

In Dashboard → Domains, add the domain you will send email from. Follow the Verify your domain guide to configure SPF, DKIM and DMARC.

Verify domain →

4. Send with the Node SDK

Use the snippet below as a starting point. Replace from with an address from your verified domain.

send-first.ts
import { CoffeeMail } from '@coffeemail/node'; const coffeemail = new CoffeeMail(process.env.COFFEEMAIL_API_KEY); const { data, error } = await coffeemail.emails.send({  from: 'noreply@seudominio.com.br',  to: 'cliente@example.com',  subject: 'Confirmação do pedido #123',  html: '<h1>Obrigado!</h1><p>Seu pedido está em processamento.</p>',}); if (error) throw error;console.log('Email enfileirado:', data.id);

5. Track delivery

Each email receives a unique id. Use coffeemail.emails.get(id) to query the status and getEvents(id) to view the full timeline.

track.ts
const { data } = await coffeemail.emails.get('eml_8f3a2c1b');console.log('Status:', data.status); const { data: events } = await coffeemail.emails.getEvents('eml_8f3a2c1b');console.log('Timeline:', events);

Common issues

  • 401: Invalid or missing API Key — make sure you are using cm_live_... in production.
  • 403: Sender domain does not belong to the organization or has not been verified.
  • 429: Rate limit per key/IP — respect Retry-After and implement exponential backoff.
  • Deliverability: Email accepted in the queue but does not arrive: check DKIM, SPF and DMARC on the domain and check blacklist in domains.getHealth.