---
title: "Send a test email using the project's saved SMTP config"
method: POST
path: "/projects/{id}/auth/config/test-email"
tags: ["Auth Configuration"]
---

# Send a test email using the project's saved SMTP config

`POST /projects/{id}/auth/config/test-email`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/projects/{id}/auth/config/test-email`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Sends a diagnostic email to `to_email` using the project's
persisted `auth_config` SMTP credentials. If `html_body` or
`text_body` is supplied, the override path is taken: those
values (plus optional `subject`) are rendered through
html/text templates against the project's `Data` and
used as the body — used by the template editor's "Send Test"
affordance to preview an unsaved template. With both bodies
omitted, a hardcoded diagnostic message is sent and any
`subject` field is ignored. Sending `subject` alone (no
bodies) is rejected with 400 to avoid a silently-dropped
subject or a blank message. Also rejects with 400 if
`email_enabled=false`, `smtp_host` is empty, or the saved
`smtp_password` can't be read and must be set again.
Sender values with interior line breaks return 400 before SMTP delivery.
Rendered override subjects containing a line break have outer whitespace
trimmed; any remaining interior line break returns 400 before delivery.

## Path parameters

- `id` string, uuid, required

## Request body

- TestEmailRequest: When `html_body` or `text_body` is provided the backend renders those (plus optional `subject`) through html/text templates against the standard `Data` (ProjectName, Name, SiteURL) and sends the result — used by the template-editor "Send Test" affordance to preview an unsaved template. When both bodies are omitted a hardcoded diagnostic message is sent to verify SMTP credentials and `subject` is ignored. Sending `subject` alone (without a body) is rejected with 400.
  - `to_email` string, email, required: Recipient address for the diagnostic email.
  - `subject` string: Optional subject override, rendered as a text/template. Only applied on the override path — requires `html_body` or `text_body` to also be set, otherwise the request is rejected with 400.
  - `html_body` string: Optional HTML body override. Rendered as an html/template. Max 256 KiB.
  - `text_body` string: Optional plain-text body override. Rendered as a text/template. Max 256 KiB.

## Response `200`

Test email sent

- TestEmailResponse
  - `success` boolean, required

## Other responses

- `400`: Invalid request, unsafe email headers, or email delivery not configured
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Project not found
- `502`: Template render failure or SMTP delivery failed

## Changes

- **2026-10-07** `23e7875e7c4c`: 1 info
  - the endpoint scheme security `ProjectAccessToken` was added to the API
- **2026-09-19** `3a6f365f3f35`: 4 breaking, 4 info
  - added the new path request parameter `id`
  - added the new required request property `to_email`
  - the request's body type changed from no type to `object`
  - the response's body type changed from no type to `object` for status `200`
  - …4 more
- **2026-08-27** `bb44e98aba2e`: 3 breaking, 5 warning
  - the request's body type changed from `object` to no type
  - the response's body type changed from `object` to no type for status `200`
  - removed the required property `success` from the response with the `200` status
  - deleted the `path` request parameter `id`
  - …4 more

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/projects/:id/auth/config/test-email/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
