Email Setup

Configure Resend for transactional emails.

Email Setup

PacBoiler uses Resend for sending transactional emails (like Magic Links and Welcome emails).

1. Create Resend Account

  1. Sign up at Resend.com.
  2. Go to API Keys.
  3. Create a new API Key with "Full Access" (or "Sending Access").
  4. Copy the key and paste it into .env.local:
RESEND_API_KEY=re_123456789

2. Verify Domain

For best deliverability, you should verify your domain.

  1. Go to Domains.
  2. Add your domain (e.g., myapp.com).
  3. Add the DNS records provided by Resend to your DNS provider (Cloudflare, GoDaddy, Vercel, etc.).
  4. Once verified, update the FROM_EMAIL in .env.local:
# Before verification (testing only)
FROM_EMAIL=onboarding@resend.dev
 
# After verification
FROM_EMAIL=noreply@myapp.com

Note: DNS verification usually takes 5-15 minutes, but can take up to 24 hours depending on your DNS provider.

3. Testing Locally

Without Domain Verification (Quick Testing)

When using onboarding@resend.dev as your FROM address, you can only send to Resend's test email addresses:

  • delivered@resend.dev - simulates successful delivery
  • bounced@resend.dev - simulates a bounce
  • complained@resend.dev - simulates a spam complaint

To test with these:

  1. Temporarily add a test email to your waitlist/database:
   INSERT INTO waitlist (email, full_name)
   VALUES ('delivered@resend.dev', 'Test User');
  1. Send your announcement or magic link through your app
  2. Check the Resend dashboard Emails section to confirm delivery

With Domain Verification (Real Testing)

Once you've verified your domain (Step 2), you can send to any real email address, including your own. This is the recommended approach for proper testing before launch.

Benefits:

  • Test with real email addresses
  • See how emails appear in actual inboxes
  • Test spam filter behavior
  • Verify links and formatting

4. Monitoring & Logs

View all sent emails in the Resend dashboard:

  1. Go to Emails in the sidebar
  2. See delivery status, open rates, and click tracking
  3. View email content and troubleshoot issues

5. Rate Limits

Free Tier:

  • 100 emails/day
  • 3,000 emails/month

Pro Tier:

  • Starting at $20/month
  • 50,000 emails/month
  • Higher sending limits

Check Resend Pricing for current limits.

Troubleshooting

Error: "API key is invalid" (401)

Causes:

  • Wrong API key in .env.local
  • API key deleted from Resend dashboard
  • API key doesn't have "Sending Access"

Solutions:

  1. Check your .env.local file has the correct key
  2. Verify the key exists in Resend dashboard → API Keys
  3. Create a new API key with "Full Access" if needed
  4. Restart your dev server after updating .env.local

Error: "Invalid to field" (422)

Causes:

  • Using onboarding@resend.dev as FROM address
  • Trying to send to real emails without domain verification

Solutions:

  1. For testing: Use delivered@resend.dev as recipient
  2. For production: Verify your domain (see Step 2)
  3. Update FROM_EMAIL to your verified domain

Emails not arriving

Check:

  1. Resend dashboard → Emails → Check delivery status
  2. Spam/Junk folder in recipient inbox
  3. Domain verification status (for custom domains)
  4. DNS records are correctly configured

DNS Verification Taking Too Long

Tips:

  • Most DNS changes propagate in 5-15 minutes
  • Some providers (like GoDaddy) can take up to 24 hours
  • Use DNS Checker to verify records are live
  • Make sure you added ALL required records (SPF, DKIM, DMARC)

Next Steps

Your app is fully configured! Now let's deploy it.

Step 5: Deployment