Email Setup (SMTP)
Supabase needs an SMTP server to send magic link emails. By default, Supabase uses a built-in email service with rate limits. For production, configure your own SMTP.
Free/Development Testing
Supabase’s built-in email works for testing with limits:
- 4 emails per hour
- Emails may land in spam
Good for development, but configure custom SMTP for production.
SMTP Providers
Option 1: Resend (Recommended)
Resend offers 3,000 free emails/month and is very easy to set up.
Setup:
- Create account at resend.com
- Add and verify your domain
- Create an API key
- In Supabase, go to Project Settings → Auth → SMTP Settings
- Add your Resend SMTP settings
Option 2: MXRoute
MXRoute is affordable email hosting ($49/year). Add your domain, create a mailbox, and use your MXRoute SMTP credentials in Supabase.
Configure in Supabase
- Go to Project Settings → Auth
- Scroll to SMTP Settings
- Toggle “Enable Custom SMTP”
- Enter your provider’s settings
- Click Save
Customize Email Template (Optional)
- Go to Authentication → Email Templates
- Select “Magic Link”
- Edit the subject and body
Example template:
<div style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; max-width: 400px; margin: 0 auto; padding: 40px 20px;">
<h2 style="color: #1a1a1a; font-size: 24px; font-weight: 600; margin-bottom: 16px;">Sign in to your account</h2>
<p style="color: #666; font-size: 16px; line-height: 1.5; margin-bottom: 24px;">Click the button below to securely sign in. This link expires in 24 hours.</p>
<a href="{{ .ConfirmationURL }}" style="display: inline-block; background-color: #000; color: #fff; font-size: 16px; font-weight: 500; padding: 12px 32px; border-radius: 8px; text-decoration: none;">Sign In</a>
<p style="color: #999; font-size: 14px; margin-top: 32px;">If you didn't request this email, you can safely ignore it.</p>
</div>Test Your Setup
- Open your app
- Go to auth screen → Enter your email
- Check your inbox (and spam folder)
- Click the magic link
- You should be logged into the app
Troubleshooting
Emails not arriving?
- Check spam folder
- Verify SMTP credentials
- Check Supabase logs: Logs → Auth
- Ensure sender domain is verified with your provider
Emails going to spam?
- Set up SPF, DKIM, and DMARC records for your domain
- Avoid spam-trigger words in subject
Rate limited?
- Default Supabase limit is 4 emails/hour
- Configure custom SMTP to remove limits