${title}

Mako 双模板(纯文本 + HTML) · STARTTLS / SSL · 指数退避重试 · Celery 异步降级

运行状态

  • 发送模式:${'已启用(真实发送)' if mail_enabled else '预览模式(不实际发送)'}
  • SMTP 服务器:${smtp_host}:${smtp_port}

接口列表

% for endpoint in endpoints: % endfor
路径 说明
${endpoint['path']} ${endpoint['desc']}

调用示例

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