360 Secure SkillHub
360 安全技能中心

Email Sender

核心功能:支持SMTP及SendGrid、Resend等API渠道发送邮件,可发HTML格式邮件、添加附件,还支持批量发送,需提前配置对应环境变量。典型场景涵盖单封邮件发送、自动化通知、批量邮件营销等。输入通过命令行参数指定收件人、主题等,或批量文件、HTML模板;输出为含发送状态、消息ID的JSON结果。

jpengcheng523-netizen
jpengcheng523-netizen
热度 42.99
最近更新 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"
}