> For the complete documentation index, see [llms.txt](https://docs.does.qa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.does.qa/test-steps/mail/wait-for-email.md).

# Wait For Email

Wait for email pauses the Test Case until a message arrives in the chosen inbox. Use it after your app sends mail, so later Mail steps read a message that is already there.

Prefer the **Test Case** inbox with `$testEmail` when the message belongs to one test. Use the **Account** inbox with `$accountEmail` when several tests share one mailbox.

![Wait for email Test Step](https://app.does.qa/screenshots/node/mail_wait_forMessage.png)

## When to use it

* Pause until a welcome, reset, or verification email arrives.
* Filter on Subject or From when the inbox may receive other messages.
* Raise **End Offset** when the app is slow to send mail (default is 5 minutes, up to 20).

For a full walkthrough, see [Interacting with emails](/guides/interacting-with-emails.md).

## Example Flow

Trigger the email, wait for it, open the message, continue from a link, then close the inbox.

![Set value, Wait for email, Open email, Touch, and Close inbox](/files/n48mX74WovMCGsikIajt)

## Configure

### Basics

| Field               | What to set                                                                                      |
| ------------------- | ------------------------------------------------------------------------------------------------ |
| **Inbox**           | `Test Case` (default) or `Account`                                                               |
| **Type**            | `New` (default) waits for a new message. `Custom` matches a property                             |
| **Property**        | When Type is Custom: `Subject`, `From`, `Reply To`, `HTML Body`, `Plain Text Body`, or `Snippet` |
| **Comparison Type** | [Comparison Type](/test-step-options/comparison-type.md)                                         |
| **Value**           | Text and/or [Values](/values/value-store.md) to match                                            |

### Advanced

| Field                                 | What to set                                                          |
| ------------------------------------- | -------------------------------------------------------------------- |
| **Start Offset**                      | How far back to look (`Test Start` by default)                       |
| **End Offset**                        | How long to keep waiting (`5 mins` by default, up to `20 mins`)      |
| **Status on fail**                    | [Failed Status](/test-step-options/failed-status.md)                 |
| **When should screenshots be taken?** | `Always` (default) or `On Failures`                                  |
| **Value Standardization**             | [Value Standardization](/test-step-options/value-standardization.md) |

{% hint style="info" %}
**Pro tip:** Subject and From are the safest filters for everyday Flows. Keep HTML Body and Snippet for cases where the subject alone is not unique.
{% endhint %}

## Related

* [Open Inbox](/test-steps/mail/open-inbox.md)
* [Select Email](/test-steps/mail/select-email.md)
* [Open Email](/test-steps/mail/open-email.md)
* [Interacting with emails](/guides/interacting-with-emails.md)
* [Mail](/test-steps/mail.md)

**Tags:** `mail`, `wait`, `email`, `inbox`
