- SMTP — Configure Supabase Auth to send confirmation, password reset, and magic link emails through Lettr
- Edge Functions — Send emails programmatically from Supabase Edge Functions using Lettr’s HTTP API
Prerequisites
Before you begin, make sure you have: You’ll also need:- A Supabase project
- A sender address on your verified domain (e.g.
noreply@yourdomain.com)
Send Auth Emails via SMTP
Supabase Auth sends emails for user confirmations, password resets, magic links, and invitations. By default these go through Supabase’s built-in email service, which has strict rate limits. Connecting Lettr via SMTP removes those limits and gives you full delivery visibility.SMTP Credentials
| Setting | Value |
|---|---|
| Host | smtp.lettr.com |
| Port | 465 |
| Username | lettr |
| Password | Your API key (starts with lttr_) |
Configure Supabase Auth
Open SMTP settings
- Go to your Supabase project dashboard
- Click Authentication in the left sidebar
- Click SMTP Settings under the Email provider section
- Toggle Enable Custom SMTP on
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)
Enter SMTP credentials
- Host:
smtp.lettr.com - Port number:
465 - Username:
lettr - Password: Your Lettr API key (starts with
lttr_)
Customize Auth Email Templates
Supabase lets you customize the HTML for each auth email type:- Go to Authentication → Email Templates in your Supabase dashboard
- Select the template type (Confirm signup, Invite user, Magic Link, Reset password)
- Edit the HTML and save
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.Send Emails from Edge Functions
For transactional emails beyond auth (order confirmations, notifications, etc.), use Supabase Edge Functions with Lettr’s HTTP API.Set Up Your API Key
Store your Lettr API key as a Supabase secret:Create an Edge Function
supabase/functions/send-email/index.ts with:
Deploy and Test
Deploy the function:Call from Your App
Invoke the Edge Function from your client-side Supabase code:Trigger from Database Webhooks
You can also trigger emails automatically when database rows change. Create a Database Webhook in Supabase that calls your Edge Function when a row is inserted into a table (e.g.orders):
- Go to Database → Webhooks in your Supabase dashboard
- Create a new webhook pointing to your
send-emailEdge Function - Set the trigger event (e.g. INSERT on the
orderstable)
Verify It Works
Check that emails are being delivered:- Trigger a test email (auth action or Edge Function call)
- Verify delivery in the Lettr logs
- Check the recipient’s inbox
Troubleshooting
Auth emails not sending after enabling SMTP
Auth emails not sending after enabling SMTP
- Verify the sender email uses a domain verified in Lettr
- Double-check that the host is
smtp.lettr.comand the port is465 - Ensure your API key is correct and starts with
lttr_ - Confirm the username is exactly
lettr(lowercase)
Edge Function returns 401 Unauthorized
Edge Function returns 401 Unauthorized
Supabase rate limit exceeded
Supabase rate limit exceeded
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 under Rate Limits.
Emails landing in spam
Emails landing in spam
Make sure your sending domain has proper DNS records:
- SPF — Authorizes Lettr to send on your behalf
- DKIM — Cryptographically signs your emails
- DMARC — Tells receivers how to handle unauthenticated mail
Using port 587 instead of 465
Using port 587 instead of 465
If port 465 doesn’t work in your environment, use port 587 with STARTTLS instead. Both are secure.