---
title: "Send your app's emails with no provider key: the while.sh docs"
url: https://while.sh/en/docs/building-blocks/emails/
updated: 2026-11-21
---

# Emails

Your app sends its emails, such as an invitation or a forgotten password, through while's SMTP relay. It keeps no provider's key.

> You, to your AI: Send a welcome email to every new sign-up.

## What your app receives

Your app receives these environment variables at every deployment:

| Variable | What it holds |
|---|---|
| `SMTP_URL` | The relay's address, username and secret included. An SMTP library, like nodemailer, takes it as is. |
| `SMTP_FROM` | The sender: noreply@ followed by the app's address. |

## When to use it

Use it for the emails your app itself sends to its users.

## How it works

The building block is opened organization by organization. To get it, ask your agent, which writes to the while team (`send_feedback`, `kind: block`) with the intended use and the expected volume. The while team decides, and your agent follows the request in `get_organization`. When it opens, the organization's admins receive an email.

Once the building block is open, the organization's production apps receive `SMTP_URL` and `SMTP_FROM` at their next deployment. Your app sends over SMTP to while's relay, with the username in `SMTP_URL`, and while sends the message on.

## What to know

A preview receives neither `SMTP_URL` nor `SMTP_FROM`. The sender is an address under the app's name, such as noreply@planning.while.cloud; an address from another domain is refused, custom domains included. A test or example address, such as example.com or .test, is accepted without anything being sent.

A message goes to 50 recipients at most and is 10 MB at most. By default, an app sends to 100 recipients per hour and 500 per day, and the organization to 1,000 per day; the while team can raise an app's limits. Beyond them, the relay asks to try again later.
