# SMTP

> Coming soon. Couryo's SMTP relay, to send without changing code. Host, ports, username, password and examples for Laravel, Node and Supabase.

Source: https://couryo.com/en/docs/smtp

> **Coming soon.** The SMTP relay is not live yet: `smtp.couryo.com` does not accept connections for now. Today, send through the [REST API](https://couryo.com/en/docs/sending.md), which already has idempotency, batches and attachments. This page shows how it will work.

For apps, frameworks and tools that already send over SMTP, swapping the credentials will be enough.

## Credentials

| Field | Value |
|---|---|
| Host | `smtp.couryo.com` |
| Port | `587` (STARTTLS), `465` (implicit TLS) or `2525` (when 587 is blocked) |
| Username | `couryo` |
| Password | your API key (`ck_live_...` or `ck_test_...`) with the `send` scope |

The sender must be on a [verified domain](https://couryo.com/en/docs/domains.md), as with the API. `ck_test_` keys also work over SMTP and capture the email without delivering it.

## Laravel

```ini title=".env"
MAIL_MAILER=smtp
MAIL_HOST=smtp.couryo.com
MAIL_PORT=587
MAIL_USERNAME=couryo
MAIL_PASSWORD=ck_live_...
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=hi@example.com
MAIL_FROM_NAME="Example"
```

## Node.js (Nodemailer)

```js title="Node.js"
import nodemailer from "nodemailer";

const transport = nodemailer.createTransport({
  host: "smtp.couryo.com",
  port: 587,
  secure: false, // STARTTLS
  auth: { user: "couryo", pass: process.env.COURYO_API_KEY },
});

await transport.sendMail({
  from: "Example <hi@example.com>",
  to: "ana@example.com",
  subject: "Hello",
  text: "Sent through Couryo over SMTP.",
});
```

## Supabase Auth and other tools

In tools with a "custom SMTP" setting (Supabase Auth, WordPress, n8n and similar), fill in host, port, username and password from the table above.

## API or SMTP?

| | API | SMTP |
|---|---|---|
| Idempotency | yes, with `Idempotency-Key` | no |
| Message `id` in the response | yes | yes, in the `DATA` response |
| Batch of up to 100 per request | yes | no |
| Code change | small | none |

Once SMTP is live, both paths will create the same events, show on the same timeline and call the same webhooks.
