360 Secure SkillHub
360 安全技能中心

Email Sender

该 Skill 提供命令行脚本,通过 SMTP 或 SendGrid、Mailgun、Resend 等邮件服务发送邮件,支持 HTML 正文、附件,以及基于收件人 CSV 与 HTML 模板的批量发送,并返回含发送状态的 JSON。使用前需自行配置相应环境变量;脚本文件本身未包含在文件列表中。

jpengcheng523-netizen
jpengcheng523-netizen
热度 43.06
最近更新 2026-05-11 17:35:58
分类:协作依赖:代码执行 / 读写文件 / 第三方 API应用场景:邮件起草 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add jpeng-email-sender
Metadata
name
jpeng-email-sender
description
Email sending skill via SMTP or API providers. Supports attachments, HTML templates, and batch sending.
version
1.0.0
author
jpeng
tags
["email","smtp","notification","communication"]

Email Sender

Send emails via SMTP or API providers (SendGrid, Mailgun, Resend).

When to Use

  • User wants to send an email
  • Automated notifications
  • Batch email campaigns
  • HTML email with attachments

Configuration

Set environment variables:

# SMTP mode
export EMAIL_SMTP_HOST="smtp.gmail.com"
export EMAIL_SMTP_PORT="587"
export EMAIL_SMTP_USER="your@email.com"
export EMAIL_SMTP_PASS="your-app-password"

# Or API mode (SendGrid)
export EMAIL_SENDGRID_API_KEY="SG.xxx"

# Or API mode (Resend)
export EMAIL_RESEND_API_KEY="re_xxx"

Usage

python3 scripts/send_email.py \
  --to "recipient@example.com" \
  --subject "Hello" \
  --body "This is the message body" \
  --html  # Optional: send as HTML

With attachments

python3 scripts/send_email.py \
  --to "recipient@example.com" \
  --subject "Report Attached" \
  --body "Please find attached." \
  --attach "/path/to/report.pdf"

Batch sending

python3 scripts/send_email.py \
  --batch recipients.csv \
  --template template.html \
  --subject "Newsletter"

Output

Returns JSON with send status:

{
  "success": true,
  "message_id": "msg_xxx",
  "to": "recipient@example.com"
}