Email sender

From wulaosiji/skills · View interactive version

Email sender is an AI agent skill from the GitHub repository wulaosiji/skills. 邮件发送统一封装工具,支持HTML模板邮件(科技感深色/浅色主题自动切换)、纯文本邮件、附件发送、营销邮件和系统通知,内置飞书SMTP配置。 Use when: "发送邮件", "发封报告邮件", "HTML邮件", "send email", "email report", "带附件的邮件", "HTML email template", "日报邮件". 强制使用模板(白天浅色/晚上深色),默认包含广告,支持高亮数据卡片和自定义页脚。Cross-references: document-hub, pdf, rss-feed, daily-report. Built by UniqueClub

How to use this skill

Skill file

Email Sender Skill

邮件发送统一封装,支持HTML模板和纯文本,内置科技感深色/浅色主题。

When to Use

Use this skill when:

Do NOT use this skill if:

Typical triggers:

Workflow

遵循六步推进法(探查→约束→证据→执行→验证→交付)完成操作。

  1. 探查 (Probe)

完整读取用户需求,确认邮件类型、收件人、主题和内容。检查网络环境(必须国内直连,VPN会导致SSL错误)。

  1. 约束 (Constrain)

根据当前时间选择邮件主题,设定不可降级的标准——必须使用模板(不允许纯文本邮件)。受阻时换通道,不降级交付物。

| 函数 | 场景 | 特点 |

|------|------|------|

| send_smart_email() | 通用 | 自动根据时间选主题 |

| send_tech_email() | 晚上/深色 | 科技感深色主题 |

| send_light_email() | 白天/浅色 | 清爽浅色主题 |

| send_email() | 简单 | 纯文本(不推荐) |

| send_email_with_attachments() | 附件 | 带文件 |

配置邮件参数:

required_params = {
    "to_email": "recipient@example.com",
    "subject": "邮件主题",
    "title": "邮件标题",        # HTML模板用
    "content": "邮件正文",       # HTML模板用
}
  1. 证据 (Evidence)

邮件内容必须来自用户输入或可追溯数据源,不编造报告内容。每个数据点必须有明确来源。

  1. 执行 (Execute)

调用邮件发送函数,先给影响与结论,再给行动和必要证据。

from skills.email_sender.email_sender import send_smart_email

send_smart_email(
    to_email='user@example.com',
    subject='AI日报',
    title='今日热点',
    content='<p>内容...</p>'
)

处理异常:

  1. 验证 (Verify)

用不同于生成路径的方式回读——检查发送返回状态为成功,确认收件人地址格式正确,验证附件文件存在且可读。如遇SSL错误,确认已关闭VPN。

  1. 交付 (Deliver)

返回邮件发送成功/失败状态,清理临时附件文件(如需要)。记录发送日志。

Output

返回邮件发送结果:

Guardrails

以下约束确保安全、可靠地使用本技能。

Anti-patterns

Email Sending Rules (Updated 2026-03-04)

强制规范:

  1. 必须使用模板 - 不允许纯文本邮件
  1. 默认包含广告 - 默认添加杭州大会广告

Network Environment

⚠️ 重要: 使用邮件功能时请保持国内网络环境

错误特征:

SSL: UNEXPECTED_EOF_WHILE_READING
EOF occurred in violation of protocol

解决方案: 关闭VPN,切换国内网络后重试。

Constraints

Core Features

1. 智能主题选择

from skills.email_sender.email_sender import send_smart_email

# 自动根据当前时间选择主题(白天浅色/晚上深色)+ 默认广告
send_smart_email(
    to_email='user@example.com',
    subject='AI日报',
    title='今日热点',
    content='<p>内容...</p>'
)

2. 深色科技感模板

from skills.email_sender.email_sender import send_tech_email

send_tech_email(
    to_email="recipient@example.com",
    subject="非凡产研 - AI日报",
    title="🦞 今日AI热点",
    subtitle="2026年3月4日",
    content="""
    <p>今日AI领域发生重大事件...</p>
    <h3>关键洞察</h3>
    <ul>
        <li>Anthropic事件持续发酵</li>
        <li>Claude登顶App Store</li>
    </ul>
    """,
    highlights=[
        {"label": "政策风向", "value": "AI军事化加速"},
        {"label": "资本流向", "value": "基础设施增长"},
        {"label": "用户态度", "value": "卸载量激增295%"}
    ],
    footer="非凡产研 | 连接技术与商业"
)

3. 浅色主题模板

from skills.email_sender.email_sender import send_light_email

send_light_email(
    to_email="recipient@example.com",
    subject='早报',
    title='今日热点',
    content='...',
    # 自动包含广告
)

4. 带附件邮件

from skills.email_sender.email_sender import send_email_with_attachments

send_email_with_attachments(
    to_email="recipient@example.com",
    subject="带附件的邮件",
    body="请查收附件",
    attachments=[
        ("report.pdf", "/path/to/report.pdf"),
        ("data.xlsx", "/path/to/data.xlsx")
    ]
)

5. 纯文本邮件(不推荐)

from skills.email_sender.email_sender import send_email

send_email(
    to_email="recipient@example.com",
    subject="测试邮件",
    body="这是一封测试邮件"
)

Template Color Scheme

| 元素 | 深色主题 | 浅色主题 |

|------|----------|----------|

| 主背景 | #0a0a0f | #ffffff |

| 卡片背景 | #12121a | #f5f5f5 |

| 主色调 | #00d4ff | #0066cc |

| 强调色 | #ff6b35 | #ff6b35 |

| 文字 | #e6e6e6 | #1a1a1a |

| 次要文字 | #888888 | #666666 |

Configuration

SMTP配置(自动从~/.openclaw/.env读取):

Workflow Integration

Workflow: 生成报告 → 发送邮件

from skills.long_form_writer import generate_report
from skills.email_sender.email_sender import send_tech_email

# 生成长文报告
report = generate_report(data, template="daily")

# 发送邮件
send_tech_email(
    to_email="team@example.com",
    subject="🦞 卓然AI日报",
    title="今日AI热点",
    content=report.html_content,
    highlights=report.key_insights
)

Workflow: 生成PDF → 邮件附件

from skills.document_hub.document_hub import write
from skills.email_sender.email_sender import send_email_with_attachments

# 生成报告文档
write("report.docx", content)

# 发送带附件邮件
send_email_with_attachments(
    to_email="client@example.com",
    subject="月度报告",
    body="请查收附件中的月度报告",
    attachments=[("月度报告.docx", "./report.docx")]
)

Dependencies

Changelog

Related Skills

About UniqueClub

Part of the UniqueClub toolkit — a collection of skills for AI-powered content creation and automation.

🌐 https://uniqueclub.ai

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.