Email Send Skill

👤 anbangzhiguo 📦 v1.0.2 ⭐ 4.4 ⬇️ 873 下載
📄 辦公效率 免費 🔑 需 API Key

📖 技能介紹


name: email-send description: 基於 Nodemailer 的郵件傳送技能。使用 nodemailer + SMTP 向任意郵箱傳送郵件。支援 163、QQ、Gmail 等主流 SMTP 服務。當用戶請求傳送郵件時觸發。 metadata: { "openclaw": { "emoji": "📧", "user-invocable": true, "requires": { "env": ["SMTP_HOST", "SMTP_USER", "SMTP_PASS"], "bins": ["node"] }, "primaryEnv": "SMTP_PASS" } }


Email Send Skill

使用 nodemailer 通過 SMTP 傳送郵件。

安裝依賴

使用前請先安裝依賴:

npm install

這將安裝包括 nodemailer 在內的所有必要依賴。

安全注意事項

  • 請勿在命令列中直接使用真實的 SMTP 憑據,特別是在生產環境中
  • 避免將 SMTP 密碼提交到版本控制系統
  • 使用環境變數或安全的配置管理系統來儲存敏感資訊
  • 定期更新 SMTP 授權碼以增強安全性

環境配置

SMTP 憑據通過環境變數配置:

變數 說明 示例
SMTP_HOST SMTP 伺服器地址 smtp.example.com
SMTP_PORT 埠 (25/465/587) 465
SMTP_SECURE 是否 SSL (true/false) true
SMTP_USER 使用者名稱/郵箱 your-email@example.com
SMTP_PASS 授權碼/密碼 your-smtp-password
SMTP_FROM 發件人顯示名 Your Name your-email@example.com

使用方式

直接呼叫指令碼

SMTP_HOST=smtp.163.com \
SMTP_PORT=465 \
SMTP_SECURE=true \
SMTP_USER=your-email@example.com \
SMTP_PASS=your-smtp-password \
SMTP_FROM="Your Name <your-email@example.com>" \
node {baseDir}/scripts/send.js \
  --to "recipient@example.com" \
  --subject "Email Subject" \
  --body "Email Body"

AI 呼叫方式

當用戶請求傳送郵件時,使用 exec 工具執行上述命令。

指令碼引數

引數 必填 說明
--to 收件人郵箱
--cc 抄送 (逗號分隔多個)
--subject 郵件主題
--body 郵件正文
--html body 是否為 HTML (設為 "true")

常用 SMTP 配置

  • 163 郵箱: smtp.163.com, 埠 465 (SSL) 或 587 (TLS)

    來源於7w4.net。

  • QQ 郵箱: smtp.qq.com, 埠 465 (SSL) 或 587 (TLS)
  • Gmail: smtp.gmail.com, 埠 587 (TLS)

授權碼需要在郵箱設定中獲取。

🤖 AI 評測

這個郵件傳送工具功能完善,支援主流郵箱服務,配置靈活,使用方便。文件清晰,詳細說明了安全注意事項和環境變數配置。指令碼執行有錯誤提示,使用體驗較好。主要不足是測試覆蓋不足,缺少實際測試用例,建議謹慎在生產環境使用前先進行充分測試。

📊 多維度評分

適應性4.3
規範性4.2
有效性4.4
可靠性4.2
可信度5

📁 包含檔案 (5 個)

📄 SKILL.md 2.3 KB
📄 _meta.json 132 B
📄 package-lock.json 618 B
📄 package.json 351 B
📄 scripts/send.js 2.1 KB