运行状态
- 发送模式:${'已启用(真实发送)' if mail_enabled else '预览模式(不实际发送)'}
- SMTP 服务器:
${smtp_host}:${smtp_port}
接口列表
| 路径 |
说明 |
% for endpoint in endpoints:
${endpoint['path']} |
${endpoint['desc']} |
% endfor
调用示例
curl -X POST http://localhost:8085/api/mail/preview \
-H "Content-Type: application/json" \
-d '{"name": "张三", "email": "zhangsan@example.com"}'
启用真实发送
export MAIL_ENABLED=1
export SMTP_HOST=smtp.example.com
export SMTP_PORT=587
export SMTP_USERNAME=noreply@example.com
export SMTP_PASSWORD=your-password
python app.py