> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lettr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Supabase

> Configure Supabase Auth to send confirmation, password reset, and magic link emails through Lettr over SMTP, with no code changes.

Configure Supabase Auth to send transactional emails (confirmations, password resets, magic links, etc.) through Lettr using the built-in SMTP integration. No code changes required — just add your SMTP credentials in the Supabase dashboard.

## Prerequisites

Before you begin, make sure you have:

<CardGroup cols={2}>
  <Card title="API Key" icon="key" href="https://app.lettr.com/api-keys">
    Create an API key in the Lettr dashboard
  </Card>

  <Card title="Verified Domain" icon="globe" href="/learn/domains/sending-domains">
    Add and verify your sending domain
  </Card>
</CardGroup>

You'll also need:

* A [Supabase](https://supabase.com) project
* A sender address on your verified domain (e.g. `noreply@yourdomain.com`)

## Get Your SMTP Credentials

You'll use the following Lettr SMTP settings when configuring Supabase:

| Setting  | Value                              |
| -------- | ---------------------------------- |
| Host     | `smtp.lettr.com`                   |
| Port     | `465`                              |
| Username | `lettr`                            |
| Password | Your API key (starts with `lttr_`) |

## Configure Supabase Auth

<Steps>
  <Step title="Open SMTP settings in Supabase">
    1. Go to your [Supabase project dashboard](https://supabase.com/dashboard)
    2. Click **Authentication** in the left sidebar
    3. Click **SMTP Settings** under the **Email** provider section
    4. Toggle **Enable Custom SMTP** on
  </Step>

  <Step title="Set sender details">
    Fill in your sender information:

    * **Sender email**: Your verified sending address (e.g. `noreply@yourdomain.com`)
    * **Sender name**: Your application name (e.g. `My App`)

    <Warning>
      The sender email must use a domain you've verified in the [Lettr dashboard](https://app.lettr.com/domains). Emails from unverified domains will be rejected.
    </Warning>
  </Step>

  <Step title="Enter SMTP credentials">
    Enter the Lettr SMTP credentials:

    * **Host**: `smtp.lettr.com`
    * **Port number**: `465`
    * **Username**: `lettr`
    * **Password**: Your Lettr API key (starts with `lttr_`)
  </Step>

  <Step title="Save">
    Click **Save** to apply the configuration. All Supabase Auth emails — confirmations, password resets, magic links, and invites — will now be sent through Lettr.
  </Step>
</Steps>

## Verify It Works

After saving, trigger a test email to confirm everything is connected:

1. Go to **Authentication** → **Users** in your Supabase dashboard
2. Click **Add user** → **Send invitation**
3. Enter your own email address and send the invite
4. Check your inbox for the invitation email

You can also verify delivery in the [Lettr logs](https://app.lettr.com/logs), where the email should appear within seconds.

<Tip>
  If you don't see the email, check the [Troubleshooting](#troubleshooting) section below or review your [Lettr logs](https://app.lettr.com/logs) for error details.
</Tip>

## Custom Email Templates

Supabase lets you customize the HTML templates for each auth email type (confirmation, invite, magic link, password reset). These templates are sent through Lettr as-is.

To edit templates:

1. Go to **Authentication** in your Supabase dashboard
2. Click **Email Templates**
3. Select the template type you want to customize
4. Edit the HTML and save

<Info>
  Supabase email templates use Go template syntax with variables like `{{ .ConfirmationURL }}`. These are processed by Supabase before the email is handed off to Lettr for delivery.
</Info>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Emails not sending after enabling custom SMTP">
    * Verify the sender email uses a domain verified in Lettr
    * Double-check that the host is `smtp.lettr.com` and the port is `465`
    * Ensure your API key is correct and starts with `lttr_`
    * Confirm the username is exactly `lettr` (lowercase)
  </Accordion>

  <Accordion title="Rate limit exceeded errors">
    Supabase applies its own rate limits on auth emails (e.g. one confirmation per 60 seconds per address). These are separate from Lettr's rate limits. Check your Supabase [Auth settings](https://supabase.com/dashboard) under **Rate Limits**.
  </Accordion>

  <Accordion title="Emails landing in spam">
    Make sure your sending domain has proper DNS records configured:

    * [SPF](/learn/domains/spf) — Authorizes Lettr to send on your behalf
    * [DKIM](/learn/domains/dkim) — Cryptographically signs your emails
    * [DMARC](/learn/domains/dmarc) — Tells receivers how to handle unauthenticated mail

    See [Deliverability Best Practices](/knowledge-base/best-practices/deliverability) for more tips.
  </Accordion>

  <Accordion title="Using port 587 instead of 465">
    If port 465 doesn't work in your environment, you can use port 587 with STARTTLS instead. Both are secure — port 465 establishes an encrypted connection immediately, while 587 upgrades via STARTTLS.
  </Accordion>
</AccordionGroup>

## What's Next

<CardGroup cols={2}>
  <Card title="SMTP Introduction" icon="server" href="/quickstart/smtp/introduction">
    Learn more about Lettr's SMTP service
  </Card>

  <Card title="Sending Domains" icon="globe" href="/learn/domains/sending-domains">
    Verify your sending domain
  </Card>

  <Card title="Deliverability" icon="chart-line" href="/knowledge-base/best-practices/deliverability">
    Improve email deliverability
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/knowledge-base/troubleshooting/delivery-issues">
    Fix common delivery issues
  </Card>

  <Card title="Supabase Integration" icon="bolt" href="/integrations/supabase">
    Full integration guide with Edge Functions
  </Card>
</CardGroup>
