---
title: "Prepare Email"
description: "Choose a test recipient, configure Resend, and download Development settings with Vercel CLI. Keep credentials out of Git and leave Production email disabled."
canonical_url: "https://vercel.com/academy/build-and-launch-with-ai/prepare-email"
md_url: "https://vercel.com/academy/build-and-launch-with-ai/prepare-email.md"
docset_id: "vercel-academy"
doc_version: "1.0"
last_updated: "2026-09-25T16:42:53.992Z"
content_type: "lesson"
course: "build-and-launch-with-ai"
course_title: "Build and Launch with AI"
prerequisites:  []
---

<agent-instructions>
Vercel Academy — structured learning, not reference docs.
Lessons are sequenced.
Adapt commands to the human's actual environment (OS, package manager, shell, editor) — detect from project context or ask, don't assume.
The lesson shows one path; if the human's project diverges, adapt concepts to their setup.
Preserve the learning goal over literal steps.
Quizzes are pedagogical — engage, don't spoil.
Quiz answers are included for your reference.
</agent-instructions>

# Prepare Email

# Prepare email

The form can check an inquiry. To send it, our server will need permission to use an email service and an address for the studio owner. We'll prepare those settings before changing the sending code.

In the website folder, confirm the saved form work and feature branch:

```sh
git status
git branch --show-current
```

Stay on `workshop-interest`. The form will keep showing its unsent message throughout this setup lesson.

## Outcome

Prepare Resend settings for Development and Preview, with local credentials excluded from Git.

## Hands-on exercise 4.3

### Choose the owner inbox

Create a [Resend account](https://resend.com) and review its current sending limits and pricing. Use your Resend account's email address as the owner inbox for this course. The test sender, `onboarding@resend.dev`, can send only to that address.

The visitor's address will become the email's *reply-to*: the address the owner would respond to. The owner recipient stays in server settings, so visitors can't choose where the form sends. We won't send a confirmation email to the visitor.

\*\*Note: Using another recipient\*\*

Sending to another inbox requires a verified domain and a sender on that domain. Keep the test sender and account inbox for this exercise; see Resend's [testing-domain restrictions](https://resend.com/docs/knowledge-base/403-error-resend-dev-domain) if you need another arrangement.

### Store the settings on Vercel

An *environment variable* is a named setting the application reads when it runs. We can keep the email credentials in these settings while the code refers to their names. An *API key* gives the server permission to use Resend; keep its value private.

Create a Resend API key with sending access. In the existing Vercel project's environment settings, add these names for **Development** and **Preview**:

| Name                  | Value                               |
| --------------------- | ----------------------------------- |
| `RESEND_API_KEY`      | The key from your Resend account    |
| `INTEREST_FROM_EMAIL` | `onboarding@resend.dev`             |
| `INTEREST_TO_EMAIL`   | Your Resend account's email address |

Development supplies the settings we'll download for our computer. Preview supplies settings to preview deployments. Leave **Production** unconfigured until 4.7, after we've tested the form and verified protection against repeated requests.

Check the project and selected environments before saving. Keep these names exactly as shown. Prefixing them with `NEXT_PUBLIC_` would make their values eligible for inclusion in browser code.

### Check the local destination

In the editor, confirm `.gitignore` includes `.env*`. Then run:

```sh
git check-ignore .env.local
git ls-files .env.local
```

The first command should print `.env.local`. The second should print nothing, confirming that Git isn't already tracking that file. If either result differs, use the troubleshooting below before downloading credentials.

Check whether `.env.local` already exists in the editor. Preserve any existing settings before accepting an overwrite prompt. Keep its contents out of fx and course notes.

### Download Development settings

From the linked website folder, run:

```sh
vercel env pull .env.local --environment development
```

Vercel CLI downloads Development settings into the ignored file. Check that the command succeeds and that `.env.local` exists, without printing its contents. The [CLI environment reference](https://vercel.com/docs/cli/env) explains environment selection.

Restart the local development server so it can read the new settings. The temporary action from 4.2 still won't send email; we'll replace it in the next lesson.

## Try It

Repeat the ignore and tracked-file checks above, then run `git status`. The downloaded file should stay out of the list of source changes.

In Vercel, verify that all three variable names are present in Development and Preview and absent from Production. Record the project name and the environment names you configured. Keep the values private.

### The ignore check prints nothing

Open `.gitignore` and add `.env*` on its own line if missing. Repeat both checks. If `.env.local` is already tracked, adding an ignore rule won't remove it from history. Stop here and have exposed keys revoked and the repository cleaned up before continuing.

### The downloaded settings are missing

Check the project linked in 3.3 and the Development scope selected in Vercel. Correct the project or scope, then repeat the download, preserving existing local settings. Preview-only settings won't appear in a Development download.

## Commit

Email settings don't belong in a commit. If the ignore rule already existed, this lesson needs no source change. If you added it, review and save only that file:

```sh
git add .gitignore
git diff --cached
git commit -m "chore(repo): ignore local email settings"
```

Keep the checkpoint on `workshop-interest`. Your setup note should contain no API key or other secret value.

## Done-When

- [ ] Development and Preview contain the three required setting names.
- [ ] The owner recipient is the Resend account inbox for the test sender.
- [ ] Development settings download successfully, and `.env.local` is ignored and untracked.
- [ ] Production email remains unconfigured and no credentials are staged.

## Solution

The completed setup has credentials in Vercel's Development and Preview environments, plus an ignored local copy for Development. Verify the project link and ignore rules before using the download command above.

The form still reports that nothing was sent. That is expected: configuring the service doesn't change the temporary Server Action.


---

[Full course index](/academy/llms.txt) · [Sitemap](/academy/sitemap.md)
