All posts
May 11, 2026 · Snapdock

How Do I Send Emails From My App?

You built an app with Claude, ChatGPT, Bolt, or Lovable and you need it to send emails. Maybe a confirmation when someone signs up. Maybe a weekly report…

You built an app with Claude, ChatGPT, Bolt, or Lovable and you need it to send emails. Maybe a confirmation when someone signs up. Maybe a weekly report. Maybe a notification when something happens. You tried asking your AI to add email sending and it wrote some code, but it did not work, or it worked locally and failed when you deployed it, or it is sending emails but they are going to spam. This is one of the most common stumbling points for non-technical builders. Here is exactly what is going on and how to fix it.

Why Sending Email Is Harder Than It Sounds

Sending an email seems simple: you type a message and click send. But sending email programmatically from an app is different, and it has a layer of complexity that trips almost every beginner.

The problem is spam. Over the decades, spam has gotten so bad that email providers have built extensive systems to identify and block suspicious email. An app that suddenly starts sending emails from a new IP address looks exactly like a spam operation. Email providers are deeply sceptical of it.

This is why the code your AI writes to send email may work perfectly on your laptop but fail in production, or send emails that go directly to spam. It is not a bug in the code. It is the email infrastructure treating your legitimate app the same way it treats spammers.

The solution is to use a dedicated email sending service rather than sending directly from your app.

The Right Way to Send Email From Your App

Email sending services exist specifically to solve this problem. They have the infrastructure, IP reputation, and relationships with email providers to ensure your emails actually reach inboxes. They handle the spam compliance, the authentication records, the bounce handling, and the delivery tracking.

The most popular options for vibe coders:

Resend is the most popular choice for new apps right now. Generous free tier of three thousand emails per month, clean API, works well with AI-generated code, and specifically designed for developers who want email to just work. Start here.

SendGrid is the most established option. Free tier of one hundred emails per day. More complex interface than Resend but more features for high-volume sending. Good if you expect to send large volumes.

Mailgun is similar to SendGrid. Strong free tier for testing, good deliverability, straightforward API.

Postmark is focused specifically on transactional email, which means emails triggered by user actions like confirmations and notifications rather than marketing. Excellent deliverability, no free tier but competitive pricing.

Getting Started With Resend

  1. Create a free account at resend.com
  2. Add and verify your domain in the Resend dashboard, this takes about fifteen minutes and involves adding DNS records to your domain registrar, the same process as pointing a domain to your app
  3. Get your API key from the Resend dashboard
  4. Add it to your .env file as RESEND_API_KEY
  5. Ask your AI: “Can you update my app to send emails using Resend? Here is what I need the email to contain: [describe it]. Use the Resend Python SDK and read the API key from an environment variable.”

Your AI will write the complete implementation including the SDK installation and the email sending code.

Why Your Emails Might Be Going to Spam

If you are already sending emails but they are landing in spam, the most common causes are:

No domain verification. If your emails come from a Gmail or generic address rather than your own domain, they are much more likely to be flagged as spam. Verify your domain with your email service.

Missing DNS records. Email authentication requires specific DNS records called SPF, DKIM, and DMARC. These prove to email providers that you are authorised to send email from your domain. Your email service will tell you exactly which records to add.

Email content triggers. Certain words, excessive links, or image-heavy content trigger spam filters. Start with simple plain text emails.

Ask your AI: “My emails are going to spam. Can you help me diagnose why and fix it? I am using [email service].”

The One Thing to Remember

Sending email from your app requires a dedicated email sending service, not your personal email account or a direct SMTP connection. Resend is the best starting point for most vibe-coded apps. Verify your domain, add your API key to your .env file, and ask your AI to write the integration. If emails are going to spam, check that your DNS authentication records are configured correctly.


Want your app sending emails reliably from the cloud? → Snapdock

New here? These might help: What is a .env file? Why your app needs one and how to use it. → What is an API? The honest explanation nobody bothers to give you. →