---
title: "配置SMTP服务器"
method: POST
path: "/api/alarm/smtp/set"
tags: ["告警配置"]
---

# 配置SMTP服务器

`POST /api/alarm/smtp/set`

## Request body

- object
  - `address` string — 发件邮箱地址
  - `display_name` string — smtp模版名称
  - `email` string, required — 发件邮箱账号
  - `event_last_send` string, date-time — 最后一次发送事件的时间
  - `id` integer — smtp配置模版id
  - `monthly_last_send` string, date-time — 每月的最后一次发送时间
  - `no_key` boolean — 是否设置密码
  - `password` string — 发件邮箱密码
  - `port` integer, required — SMTP 服务器端口号
  - `server` string, required — SMTP 服务器地址
  - `type` string — 传输加密方式
  - `username` string — smtp模版所属用户

## Response `200`

- object
  - `data` SMTPServerDetail
    - `address` string — 发件邮箱地址
    - `display_name` string — smtp模版名称
    - `email` string, required — 发件邮箱账号
    - `event_last_send` string, date-time — 最后一次发送事件的时间
    - `id` integer — smtp配置模版id
    - `monthly_last_send` string, date-time — 每月的最后一次发送时间
    - `no_key` boolean — 是否设置密码
    - `password` string — 发件邮箱密码
    - `port` integer, required — SMTP 服务器端口号
    - `server` string, required — SMTP 服务器地址
    - `type` string — 传输加密方式
    - `username` string — smtp模版所属用户
  - `err` string — 错误信息
  - `msg` string — 具体错误信息描述

---

[API](https://skmtc.dev/chaitin/apis/api.md) · [All operations](https://skmtc.dev/chaitin/apis/api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/chaitin/api/revisions/d9ff672af20c/schema)
