> For AI agents: the complete documentation index is available at https://www.tteam.icu/zh/llms.txt, the full documentation bundle is available at https://www.tteam.icu/zh/llms-full.txt.

# 邮件服务


AI 总结AI 生成

**核心内容**：介绍使用 mail-provider 服务发送邮件通知的方法，支持 SMTP 协议。
**内容要点**：
- mail-provider 的部署与 SMTP 配置
- 邮件发送接口和参数说明
- 在告警、脚本和自动化任务中复用邮件通知
内容偏向可直接复用的运维操作，涵盖命令、配置顺序和部署注意事项。

```sh file="./mail-provider/setup.sh" title="setup.sh"
docker rm -f mail-provider

docker run -d \
--name mail-provider \
-v /etc/timezone:/etc/timezone:ro \
-v /etc/localtime:/etc/localtime:ro \
--restart=always \
-p 4000:4000 \
-v $(pwd)/config/cfg.json:/app/cfg.json \
registry.cn-hangzhou.aliyuncs.com/buyfakett/mail-provider
```

其中 `password` 填写 SMTP 的秘钥。

```json file="./mail-provider/config/cfg.json" title="cfg.json"
{
  "debug": true,
  "http": {
    "listen": "0.0.0.0:4000",
    "token": ""
  },
  "smtp": {
    "addr": "smtp.qq.com:587",
    "username": "buyfakett@vip.qq.com",
    "password": "smtp",
    "from": "buyfakett@vip.qq.com"
  }
}
```

发送邮件示例:

```shell
curl http://127.0.0.1:4000/sender/mail -d "tos=buyfakett@vip.qq.com&subject=svn备份通知&content=111"
```
