---
title: "Email"
---

{/* Auto-generated by scripts/generate_core_action_docs.py; do not edit by hand. */}

## `core.send_email_smtp`

Send email using SMTP.

### Secrets

Required secrets:

- `smtp`: required values `SMTP_HOST`, `SMTP_PORT`, `SMTP_USER`, `SMTP_PASS`.

### Inputs

<ParamField path="body" type="string" required>

Body content of the email

</ParamField>

<ParamField path="recipients" type="array[string]" required>

List of recipient email addresses

</ParamField>

<ParamField path="sender" type="string" required>

Email address of the sender

</ParamField>

<ParamField path="subject" type="string" required>

Subject of the email

</ParamField>

<ParamField path="allowed_attributes" type="map[string, array[string]] | null">

Key-value pairs of allowed attributes to add to the email body. e.g. &#123;'*': ['style']&#125;. This allows all tags to have a style attribute

Default: `null`.

</ParamField>

<ParamField path="bcc" type="string | array[string] | null">

Recipient(s) to be copied in the BCC field

Default: `null`.

</ParamField>

<ParamField path="cc" type="string | array[string] | null">

Recipient(s) to be copied in the CC field

Default: `null`.

</ParamField>

<ParamField path="content_type" type="string">

Email content type ('text/plain' or 'text/html'). Defaults to 'text/plain'.

Default: `"text/plain"`.

Allowed values: `text/plain`, `text/html`.

</ParamField>

<ParamField path="enable_auth" type="boolean">

Enable SMTP authentication

Default: `false`.

</ParamField>

<ParamField path="enable_ssl" type="boolean">

Enable SSL for secure connection

Default: `false`.

</ParamField>

<ParamField path="enable_starttls" type="boolean">

Enable STARTTLS for secure connection

Default: `false`.

</ParamField>

<ParamField path="headers" type="map[string, string] | null">

Additional email headers

Default: `null`.

</ParamField>

<ParamField path="ignore_cert_errors" type="boolean">

Ignore SSL certificate errors

Default: `false`.

</ParamField>

<ParamField path="reply_to" type="string | array[string] | null">

Email address(es) to be used in the Reply-To field

Default: `null`.

</ParamField>

<ParamField path="sender_prefix" type="string | null">

Email address prefix of the sender

Default: `null`.

</ParamField>

<ParamField path="timeout" type="number | null">

Timeout for SMTP operations in seconds

Default: `null`.

</ParamField>

### Examples

**Send a notification**

```yaml
- ref: notify_team
  action: core.send_email_smtp
  args:
    sender: no-reply@example.com
    recipients:
      - secops@example.com
    subject: "Tracecat alert ${{ TRIGGER.alert_id }}"
    body: "Severity: ${{ TRIGGER.severity }}"
    content_type: text/plain
    enable_starttls: true
    enable_auth: true
```
