# SendGrid

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

Web page: https://buildladder.com/tools/sendgrid

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.

- Made by: Twilio
- Official site: https://www.twilio.com/en-us/sendgrid
- Cost: 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.
- What you need first: A SendGrid account with two-factor sign-in turned on, and a domain you can add DNS records to.
- Who it helps: 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.
- Updated: 2026-11-10

## 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.

What you’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.

### 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 (https://www.twilio.com/en-us/products/email-api/pricing): It starts with a free trial

### 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.

### 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.

Compare SendGrid with the other options: https://buildladder.com/concepts/email.md
