> For the complete documentation index, see [llms.txt](https://docs.baas.sh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.baas.sh/baas-console/automations/actions/email.md).

# Email

Send an email through your project's own SMTP transport.

The Email action sends an email through your project's SMTP transport. In this guide, the order-paid automation from the [Webhook](/baas-console/automations/triggers/webhook.md) page mails the customer a confirmation, addressed with the payload the webhook received.

{% hint style="info" %}
**The Email plugin needs a one-time setup.** Configure the SMTP transport and a From address in [Action Plugins](/baas-console/action-plugins.md#email), then activate the plugin.
{% endhint %}

## Compose the email

{% stepper %}
{% step %}

### Pick the Email type

[Add a step](/baas-console/automations/actions.md) to the pipeline and pick **Email**.
{% endstep %}

{% step %}

### Address it

**Recipient (To)** takes one or more addresses, separated by commas, as literals or templates. In our example, the webhook body carries the buyer's address: `{{trigger.body.customerEmail}}`. In [batch mode](/baas-console/automations/batch.md), the field holds each user's email instead, and a user without one fails the run.
{% endstep %}

{% step %}

### Write the subject and body

**Subject** is the one-liner in the inbox; in our example, `Your order {{trigger.body.orderId}} is confirmed`. **Body (HTML)** is the message itself, written in an HTML editor:

```html
<p>Thanks for your purchase!</p>
<p>Order <strong>{{trigger.body.orderId}}</strong> is confirmed and on its way.</p>
```

{% endstep %}

{% step %}

### Save

Click **Save**. The email now goes out on every run.
{% endstep %}
{% endstepper %}

## From and Reply-To

The **Advanced** section holds **From (optional)** and **Reply-To (optional)**. Leave them empty and the plugin's project settings provide the sender; fill in **From** to override it for this action alone. One of the two places must hold a From address, or the send fails at run time.

## What the next step receives

`{ messageId }`: the message id reported by the SMTP transport, read as `{{context.previous.messageId}}`.

{% hint style="info" %}
**Accepted is not delivered.** The action succeeds when your SMTP server accepts the message; delivery to the inbox is up to the receiving side.
{% endhint %}

## Next

* [Webhook](/baas-console/automations/triggers/webhook.md): the trigger feeding this example.
* [Action Plugins](/baas-console/action-plugins.md#email): the SMTP transport setup.
* [Actions](/baas-console/automations/actions.md): back to the section overview.
