Skip to content

Services · by Twilio

SendGrid

Send automatic messages from your app and manage email campaigns, such as a newsletter, in the same service.

A ticket buyer may expect a receipt immediately and choose to receive a monthly concert calendar later. SendGrid supports both jobs. Your app can trigger the receipt after a purchase, while you prepare the calendar for people who subscribed.

Try sending yourself a sample of each. The receipt should clearly identify the purchase. The calendar should tell you why you received it and give you a way to unsubscribe from future editions.

When to use it
When your team already uses Twilio, or you want app emails and marketing emails in one service.
When to skip it
If you want to stay on a free plan. SendGrid has none, so your product’s emails stop after the trial unless you pay.
What it costs
A 60-day free trial sends 100 emails a day, with no card. Essentials starts at $19.95 a month, and Pro at $89.95. Checked 9 Nov 2026.

Send emails with SendGrid

Use SendGrid to send one email your product needs, such as a welcome note or receipt. First you authenticate a domain you own.

You’ll need

  • A website or app you started, open in your AI tool.
  • PLAN.md from the Plan your idea guide.
  • A domain you own, like yourname.com, and the sign-in for its DNS settings.
  • SendGrid account.

Your part

  • Create the SendGrid account and turn on two-factor sign-in.
  • Add the DNS records where you manage your domain.
  • Create the API key and type it into .env.

Copy the prompt for these steps

All 5 steps, in one prompt
I’m following “Send emails with SendGrid” on BuildLadder.
What the guide says I’ll end up with: Your product sends one real email from your own domain through SendGrid, and you’ve checked that it lands in an inbox.
This comes from https://buildladder.com/tools/sendgrid#email. If you can open web pages, read https://buildladder.com/tools/sendgrid.md for the current version. BuildLadder guide, tool, concept, answer and setup pages all work this way: add .md to the address.

How to work with me:
- Go through the steps below in order, one at a time.
- Do what you can yourself in this folder: write code, run commands, check settings. If a service has an official command-line tool, like the Vercel CLI, you can offer to use it. Ask me before you install anything, sign in to anything or spend money.
- When a step needs me, like making an account or clicking in a dashboard, tell me exactly what to do in small steps. Then wait until I say it’s done.
- The actions, checks and fixes in each step were written for me, the reader. Where one says “your AI tool”, that means you, and “Say:” means something I would say to you.
- Never ask me to paste passwords or secret keys into this chat. I type those into the service’s own settings.
- After each step, tell me how to check it worked. Once Git is set up, save a version each time a step works. Then ask if I’m ready for the next one.
- Use plain words. I may never have coded before.

## Step 1 of 5: Create a SendGrid account

This step is mine to do. Walk me through it, one action at a time:
- Go to twilio.com/en-us/products/email-api/pricing and start the free trial.
- Turn on two-factor sign-in when SendGrid asks. Keep any recovery codes in your password manager.
- Note today’s date. The free trial lasts 60 days, and then sending stops unless you pick a plan.

It worked when: You can sign in to the SendGrid console, and two-factor sign-in is on.

If something goes wrong:
- Your new account says it’s under review or inactive. Look for an email from SendGrid’s support team. It may ask for more details before your trial starts.

## Step 2 of 5: Authenticate your sending domain

This step is mine to do. Walk me through it, one action at a time:
- In the SendGrid console, select Settings, then Sender Authentication. In the Domain Authentication section, click Get Started.
- Choose where your domain’s DNS is managed. Pick I’m not sure if you don’t know.
- When it asks about branded links, choose No for now. Click Next.
- In Domain You Send From, type your domain, like yourname.com, with no www.
- Click Advanced Settings and leave Use automated security checked. Click Next.
- On the Install DNS Records page, add each record to your domain’s DNS settings. Copy and paste each name and value exactly, with nothing extra.
- If your domain uses Cloudflare, set the cloud icon on these records to gray, which means DNS only.
- Back in SendGrid, ask it to verify the records. DNS updates can take up to 48 hours. You can carry on with “Create a key and save it in .env” while you wait.

It worked when: The Sender Authentication page shows your domain as verified.

If something goes wrong:
- You see an Automatic Setup tab with a Connect button. Your domain is with GoDaddy. Click Connect and sign in to GoDaddy, and SendGrid adds the records for you.
- It still won’t verify after 48 hours. Compare each record with SendGrid’s page, letter by letter. If it still fails, contact SendGrid’s support.
- Your DNS settings won’t accept an underscore in a CNAME record. Start again and uncheck Use automated security. SendGrid then gives you TXT and MX records instead.

## Step 3 of 5: Create a key and save it in .env

This step is mine to do. Walk me through it, one action at a time:
- In the SendGrid console, go to Settings, then API Keys. Click Create API Key.
- Type a name for the key in API Key Name, like your product’s name.
- Choose Custom Access for the API key. Give Mail Send permission to send mail and leave unrelated permissions off.
- Click Create & View. Click the key to copy it. SendGrid won’t show it again.
- In your product’s folder, open the file named .env. If there isn’t one, ask your AI tool to create an empty one, then open it yourself.
- Add one line: SENDGRID_API_KEY= followed by your key, with no spaces. Save the file.
- Don’t save a version in Git yet. “Send one email your product needs” first checks that Git ignores .env.

It worked when: Your .env file has one line that starts SENDGRID_API_KEY= and holds your key.

If something goes wrong:
- You lost the key or pasted it somewhere public. Delete it on the API Keys page and create a new one. Then update the line in .env.

## Step 4 of 5: Send one email your product needs

Read PLAN.md in this folder. It has my plan and the tools I chose.

I want my product to send one email using SendGrid. Pick the one email from my plan that matters most, like a welcome email after sign-up or a receipt after payment. If my plan has neither, suggest an email to me whenever someone sends my contact form. Tell me which one and wait for my OK.

Before you write code:
- Check that .env is listed in .gitignore. If it isn’t, add it. Don’t open or print .env.
- Create .env.example with only the variable name SENDGRID_API_KEY and no value.
- Check SendGrid’s current official docs for my framework, and use SendGrid’s official library.

Then build it:
- Send the email only from server code, like an API route or a server function. Never send it from the browser or the phone app.
- Read the key from the SENDGRID_API_KEY environment variable. Never put the key in code, logs or Git.
- Never use a variable name the browser or app can read, such as one starting with NEXT_PUBLIC_ or EXPO_PUBLIC_.
- If my product has no server part yet, suggest the simplest one for my setup and ask me first.
- Check the response. SendGrid answers 202 when it accepted the email. If sending fails, the rest of the product must keep working. For example, sign-up should still finish.
- Send from an address at the domain I authenticated. Make the sender address one setting that’s easy to change later.
- Use a real sender name and an address people can reply to, not a “no-reply” address.

Work with my existing code and keep everything that already works. Ask before making a big change.

When you’re done, explain what you changed in plain words and tell me exactly how to make the email send.

It worked when: Your product sends the email when you do the action, and it arrives at your own address.

Before we move on, check with me:
- Did your product log a 202 answer from SendGrid?

If something goes wrong:
- It says the key is wrong or not allowed. Check that the line in .env starts with SENDGRID_API_KEY= and has no spaces. Then restart your product so it reads the file again. Make sure the key has Mail Send access.
- Your domain isn’t verified yet and you want to test. Follow SendGrid’s Single Sender Verification setup. Switch to your authenticated domain before you send to other people.
- Sign-up breaks when the email fails. For an optional welcome email, ask your AI tool to show a retryable error without blocking sign-up. Email confirmation still needs to work before the account is confirmed.

## Step 5 of 5: Check it lands in the inbox

This step is mine to do. Walk me through it, one action at a time:
- Make the email send the real way, like signing up with a new account. Use a Gmail address and one other inbox, like Outlook.
- In SendGrid’s email activity history, find the test message and check whether the receiving mail server accepted it.
- Open each inbox. If the email isn’t there, look in the spam or junk folder.

It worked when: Your email arrives in the main inbox, sent from your own domain.

Before we move on, check with me:
- Do the sender name and address look right?

If something goes wrong:
- It lands in spam. New domains need time to earn trust. Keep the email simple, and send a few at a time at first.
- Emails stopped sending after a while. Your free trial may have ended. Pick a plan in Settings, then Account Details, then Your Products.
- It works on your computer but not online. Your host needs the key too. Add SENDGRID_API_KEY in its settings, then put your product online again.

The steps

  • Steps marked AI tool are done by your AI tool when you paste the prompt. The rest are yours.
  • Save a version after every step that works.
  • If a screen looks different from a step, ask your AI tool where the setting moved.
  • Never paste a password or secret key into the chat.
  1. SendGrid, ready to send

    Create a SendGrid account

    You

    Your product sends email through your SendGrid account, so you make that first.

    1. Go to twilio.com/en-us/products/email-api/pricing and start the free trial.
    2. Turn on two-factor sign-in when SendGrid asks. Keep any recovery codes in your password manager.
    3. Note today’s date. The free trial lasts 60 days, and then sending stops unless you pick a plan.

    It worked when: You can sign in to the SendGrid console, and two-factor sign-in is on.

    Your new account says it’s under review or inactive.

    Look for an email from SendGrid’s support team. It may ask for more details before your trial starts.

  2. Authenticate your sending domain

    You

    Inboxes trust email more when the sender proves the domain is theirs. You prove it by copying a few DNS records from SendGrid into your domain’s settings.

    1. In the SendGrid console, select Settings, then Sender Authentication. In the Domain Authentication section, click Get Started.
    2. Choose where your domain’s DNS is managed. Pick I’m not sure if you don’t know.
    3. When it asks about branded links, choose No for now. Click Next.
    4. In Domain You Send From, type your domain, like yourname.com, with no www.
    5. Click Advanced Settings and leave Use automated security checked. Click Next.
    6. On the Install DNS Records page, add each record to your domain’s DNS settings. Copy and paste each name and value exactly, with nothing extra.
    7. If your domain uses Cloudflare, set the cloud icon on these records to gray, which means DNS only.
    8. Back in SendGrid, ask it to verify the records. DNS updates can take up to 48 hours. You can carry on with “Create a key and save it in .env” while you wait.

    It worked when: The Sender Authentication page shows your domain as verified.

    You see an Automatic Setup tab with a Connect button.

    Your domain is with GoDaddy. Click Connect and sign in to GoDaddy, and SendGrid adds the records for you.

    It still won’t verify after 48 hours.

    Compare each record with SendGrid’s page, letter by letter. If it still fails, contact SendGrid’s support.

    Your DNS settings won’t accept an underscore in a CNAME record.

    Start again and uncheck Use automated security. SendGrid then gives you TXT and MX records instead.

  3. Create a key and save it in .env

    You

    An API key is a secret code that lets your product send email through your account. It goes in a file called .env, which stays on your computer.

    1. In the SendGrid console, go to Settings, then API Keys. Click Create API Key.
    2. Type a name for the key in API Key Name, like your product’s name.
    3. Choose Custom Access for the API key. Give Mail Send permission to send mail and leave unrelated permissions off.
    4. Click Create & View. Click the key to copy it. SendGrid won’t show it again.
    5. In your product’s folder, open the file named .env. If there isn’t one, ask your AI tool to create an empty one, then open it yourself.
    6. Add one line: SENDGRID_API_KEY= followed by your key, with no spaces. Save the file.
    7. Don’t save a version in Git yet. “Send one email your product needs” first checks that Git ignores .env.

    It worked when: Your .env file has one line that starts SENDGRID_API_KEY= and holds your key.

    You lost the key or pasted it somewhere public.

    Delete it on the API Keys page and create a new one. Then update the line in .env.

  4. Your first email

    Send one email your product needs

    AI tool

    Your AI tool adds one email from your plan, like a welcome note or a receipt. Your product’s server sends it, so the key stays secret.

    It worked when: Your product sends the email when you do the action, and it arrives at your own address.

    Check this step
    • Did your product log a 202 answer from SendGrid?
    It says the key is wrong or not allowed.

    Check that the line in .env starts with SENDGRID_API_KEY= and has no spaces. Then restart your product so it reads the file again. Make sure the key has Mail Send access.

    Your domain isn’t verified yet and you want to test.

    Follow SendGrid’s Single Sender Verification setup. Switch to your authenticated domain before you send to other people.

    Sign-up breaks when the email fails.

    For an optional welcome email, ask your AI tool to show a retryable error without blocking sign-up. Email confirmation still needs to work before the account is confirmed.

  5. Check it lands in the inbox

    You

    An email can be delivered and still land in spam. Send it from your verified domain to real inboxes, and look where it ends up.

    1. Make the email send the real way, like signing up with a new account. Use a Gmail address and one other inbox, like Outlook.
    2. In SendGrid’s email activity history, find the test message and check whether the receiving mail server accepted it.
    3. Open each inbox. If the email isn’t there, look in the spam or junk folder.

    It worked when: Your email arrives in the main inbox, sent from your own domain.

    Check this step
    • Do the sender name and address look right?
    It lands in spam.

    New domains need time to earn trust. Keep the email simple, and send a few at a time at first.

    Emails stopped sending after a while.

    Your free trial may have ended. Pick a plan in Settings, then Account Details, then Your Products.

    It works on your computer but not online.

    Your host needs the key too. Add SENDGRID_API_KEY in its settings, then put your product online again.

Compare SendGrid with the other options

Stuck? Try these, in order
  1. Stop asking it to “fix it”. Say exactly what’s wrong.

    Paste this into the same chat. It asks your AI tool to find the problem with you.

    Troubleshooting prompt
    I’m following “SendGrid” on BuildLadder and something isn’t working.
    This comes from https://buildladder.com/tools/sendgrid. If you can open web pages, read https://buildladder.com/tools/sendgrid.md for the current version. BuildLadder guide, tool, concept, answer and setup pages all work this way: add .md to the address.
    
    Ask me which step I’m on, what I tried and what happened, one question at a time. Look at the files in this folder if you can. Then explain the problem in plain words and suggest the smallest fix. Don’t change anything that already works.

  2. Check the service isn’t down.

    If you use one of these, open its status page before changing any code: Supabase, Vercel, Netlify, Cloudflare, Stripe, Clerk, Firebase, Resend, GitHub, Expo, Claude, OpenAI.

  3. Go back to your last saved version.
    Troubleshooting prompt
    Take my product back to the last saved version that worked. First show me which version that is and what will change. Don’t delete anything else.

  4. Make the change smaller.
    Troubleshooting prompt
    Let’s make a smaller change. Undo what you just tried. Then do only the first part of it, and tell me how to check that part works before we go on.

  5. Ask a person.

    Copy this, fill in each line, and post it in a community like r/vibecoding. Take out any keys or passwords first.

    Problem report
    What I'm building: (one sentence)
    What I asked my AI tool to do: (the last request)
    What I expected: (what should happen)
    What happened instead: (what you see)
    The exact error, if any: (copy it here)
    What I've tried: (each attempt, in order)
    My tools: (AI tool, website or app, hosting)

Look things up

Questions people ask

Words used on this page

Sending domain
A sending domain is the domain your app’s emails come from, like updates.yourname.com. You prove it’s yours with a few DNS settings, so inboxes trust your emails more.
DNS record
A DNS record is one line in your domain’s settings. It tells the internet where to send visitors, such as to your hosting service.
CNAME record
A CNAME record is a DNS record that points one name to another name, instead of to an IP address. It’s often used for www and other subdomains.
API key
An API key is a long code that tells a service your app is allowed to use it. Many keys are secret, so treat them like passwords and keep them out of shared code.
Environment variable
An environment variable is a named setting stored outside your code, such as an API key or a database address. Your app reads it when it runs, so secrets stay out of your shared files.
Backend
The backend is the behind-the-scenes part of an app that visitors never see. It runs on a server, where it saves data and checks who is signed in.
Hosting
Hosting is a service that keeps your website on computers that stay online, so anyone can visit anytime. Many hosts have a free plan for small sites.

Official pages

Updated · Twilio