名称: custom-smtp-sender
描述: 通过读取 /home/bb/.openclaw/smtp-config.json 中的现有 SMTP 配置,实现支持 Markdown、HTML 文本和附件的邮件发送技能。包含重试机制与日志记录。
自定义邮件发送技能,支持高级选项,包括 HTML/Markdown 转换、附件和重试处理。集成现有配置,确保操作安全可靠。
/home/bb/.openclaw/ 的 smtp-config.json示例:
{
"server": "smtp.exmail.qq.com",
"port": 465,
"username": "your-email@example.com",
"password": "your-password",
"emailFrom": "your-email@example.com",
"useTLS": true
}
请确保文件权限安全(例如使用 chmod 600)。
发送基础邮件:
custom-smtp-sender send --to "recipient@example.com" --subject "Hello" --body "你好"
发送带附件的 HTML 邮件:
custom-smtp-sender send \
--to "recipient@example.com" \
--subject "Weekly Report" \
--body "**重要更新见内。** 请查看附件。" \
--html \
--attachments path/to/file.pdf
工具在发送失败时会自动重试最多 3 次,并记录每次尝试。网络或凭据问题会详细报告。
只需一次配置 SMTP 服务,即可轻松将邮件功能集成到您的工作流程中!