配置方式
Teable 支持两种方式配置邮件服务:
方式一:管理面板(推荐)
最简单的配置方式是通过管理面板:
- 使用管理员账号登录(默认为第一个注册的用户)
- 进入 管理面板 → 设置
- 找到 邮件配置 部分
- 点击 + 或 ✏️ 按钮进行配置
管理面板配置支持在线测试 — 保存前可以验证 SMTP 设置是否正确。
配置字段说明
| 字段 | 说明 | 示例 |
|---|
| SMTP 主机 | SMTP 服务器地址 | smtp.qq.com |
| 端口 | SMTP 端口 | 465 (SSL) 或 587 (TLS) |
| 安全连接 | 使用 SSL/TLS | true |
| 发件人邮箱 | 发件地址 | [email protected] |
| 发件人名称 | 显示名称 | 系统通知 |
| 用户名 | SMTP 认证用户 | [email protected] |
| 密码 | SMTP 密码或授权码 | xxxxxxxxxxxxxx |
方式二:环境变量
如果你更倾向于基于文件的配置,可以使用环境变量:
BACKEND_MAIL_HOST=smtp.example.com
BACKEND_MAIL_PORT=465
BACKEND_MAIL_SECURE=true
BACKEND_MAIL_SENDER=[email protected]
BACKEND_MAIL_SENDER_NAME=系统通知
BACKEND_MAIL_AUTH_USER=username
BACKEND_MAIL_AUTH_PASS=your_password
修改环境变量后,需要重启 Teable 容器才能生效。
SMTP 服务商配置示例
# 获取方式:阿里云控制台 → 邮件推送 → SMTP设置 → 生成密码
BACKEND_MAIL_HOST=smtpdm.aliyun.com
BACKEND_MAIL_PORT=465
BACKEND_MAIL_SECURE=true
BACKEND_MAIL_SENDER=[email protected] # 需在控制台验证过的发信地址
BACKEND_MAIL_SENDER_NAME=系统通知
BACKEND_MAIL_AUTH_USER=your_smtp_username # 控制台显示的SMTP账号
BACKEND_MAIL_AUTH_PASS=xxxxxxxxxxxxxx # 控制台生成的SMTP密码
# 获取方式:登录网页版QQ邮箱 → 设置 → 账户 → 开启「POP3/SMTP服务」→ 获取授权码
BACKEND_MAIL_HOST=smtp.qq.com
BACKEND_MAIL_PORT=465
BACKEND_MAIL_SECURE=true
BACKEND_MAIL_SENDER=[email protected]
BACKEND_MAIL_SENDER_NAME=系统通知
BACKEND_MAIL_AUTH_USER=[email protected]
BACKEND_MAIL_AUTH_PASS=xxxxxxxxxxxxxx # 16位SMTP授权码
# 获取方式:登录163邮箱 → 设置 → POP3/SMTP → 开启「客户端授权密码」
BACKEND_MAIL_HOST=smtp.163.com
BACKEND_MAIL_PORT=465
BACKEND_MAIL_SECURE=true
BACKEND_MAIL_SENDER=[email protected]
BACKEND_MAIL_SENDER_NAME=系统通知
BACKEND_MAIL_AUTH_USER=[email protected]
BACKEND_MAIL_AUTH_PASS=xxxxxxxxxxxxxx # 客户端授权密码
# 获取方式:Google账号 → 安全 → 两步验证 → 应用专用密码
BACKEND_MAIL_HOST=smtp.gmail.com
BACKEND_MAIL_PORT=465
BACKEND_MAIL_SECURE=true
BACKEND_MAIL_SENDER=[email protected]
BACKEND_MAIL_SENDER_NAME=系统通知
BACKEND_MAIL_AUTH_USER=[email protected]
BACKEND_MAIL_AUTH_PASS=xxxxxxxxxxxxxx # 16位应用密码
# 获取方式:AWS Console → Simple Email Service → SMTP Settings → Create SMTP Credentials
BACKEND_MAIL_HOST=email-smtp.us-east-1.amazonaws.com # 替换为你的区域
BACKEND_MAIL_PORT=465
BACKEND_MAIL_SECURE=true
BACKEND_MAIL_SENDER=[email protected] # 需在 SES 验证过的发信地址
BACKEND_MAIL_SENDER_NAME=系统通知
BACKEND_MAIL_AUTH_USER=your_smtp_username # AWS SMTP 用户名
BACKEND_MAIL_AUTH_PASS=xxxxxxxxxxxxxx # AWS SMTP 密码
相关文档