← 返回
沟通协作 Key 中文

email-reporter

Generic email reporting tool for OpenClaw agents. Auto-converts Markdown to PDF and sends as attachments.
通用 OpenClaw 代理邮件报告工具,自动将 Markdown 转 PDF 并附件发送。
dirkcaiusa
沟通协作 clawhub v1.0.0 1 版本 99857.1 Key: 需要
★ 0
Stars
📥 699
下载
💾 8
安装
1
版本
#latest

概述

Email Reporter Skill

Overview

A unified email reporting tool for OpenClaw agents. Automatically converts Markdown reports to PDF when images are detected, and sends them as attachments.

Features

  • Smart Format Detection: Auto-converts to PDF for reports with images or large files (>500KB)
  • Markdown Support: Native Markdown rendering with syntax highlighting
  • Flexible Configuration: Environment variables or config file for email settings
  • Multiple Backends: Support for msmtp, SMTP, and sendmail

Installation

clawhub install email-reporter

Configuration

Option 1: Environment Variables (Recommended)

export EMAIL_SENDER="your-email@qq.com"
export EMAIL_RECIPIENT="recipient@example.com"
export EMAIL_SMTP_HOST="smtp.qq.com"
export EMAIL_SMTP_PORT="587"
export EMAIL_SMTP_USER="your-email@qq.com"
export EMAIL_SMTP_PASS="your-auth-code"

Option 2: Config File

Create ~/.email_reporter.conf:

{
  "sender": "your-email@qq.com",
  "recipient": "recipient@example.com",
  "smtp_host": "smtp.qq.com",
  "smtp_port": 587,
  "smtp_user": "your-email@qq.com",
  "smtp_pass": "your-auth-code",
  "use_msmtp": false
}

Option 3: Command Line

python3 email_reporter.py report.md --sender me@qq.com --to friend@example.com

Usage

Basic Usage

# Send report to default recipient
python3 email_reporter.py report.md

# Specify agent name (used in subject)
python3 email_reporter.py report.md --agent "my-agent"

# Custom recipient
python3 email_reporter.py report.md --to "friend@example.com"

# Custom subject
python3 email_reporter.py report.md --subject "My Analysis Report"

In Your Agent

import subprocess

# Send a report
subprocess.run([
    "python3", "skills/email-reporter/email_reporter.py",
    "reports/analysis.md",
    "--agent", "invest-agent",
    "--to", "recipient@example.com"
])

File Format Selection

ScenarioFormatDelivery
----------------------------
Plain text (<100KB)MarkdownDirect
With images or >500KBPDFAttachment
Data tablesMarkdown + CSVAttachment bundle

SMTP Setup Guide

QQ Mail (腾讯)

  1. Enable SMTP: 设置 → 账户 → 开启SMTP服务
  2. Generate auth code (not your password!)
  3. Use auth code as EMAIL_SMTP_PASS

Gmail

  1. Enable 2FA
  2. Generate App Password
  3. Use app password as EMAIL_SMTP_PASS

Outlook/Office 365

export EMAIL_SMTP_HOST="smtp.office365.com"
export EMAIL_SMTP_PORT="587"

Troubleshooting

Email not sending

# Test SMTP connection
python3 -c "
import smtplib
s = smtplib.SMTP('smtp.qq.com', 587)
s.starttls()
s.login('your-email@qq.com', 'your-auth-code')
print('Login OK')
"

PDF conversion fails

# Install dependencies
pip install markdown weasyprint

# For Linux (Ubuntu/Debian)
sudo apt-get install libpango-1.0-0 libpangoft2-1.0-0

License

MIT

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 04:39 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

communication-collaboration

Slack

steipete
当需要通过 slack 工具从 Clawdbot 控制 Slack 时使用,包括在频道或私信中回复消息或置顶/取消置顶项目。
★ 157 📥 47,688
communication-collaboration

Gmail

byungkyu
Gmail API 集成,托管 OAuth,支持读取、发送和管理邮件、线程、标签及草稿,适用于需要与 Gmail 交互的场景。
★ 72 📥 37,740
communication-collaboration

Himalaya

lamelas
{"answer":"通过IMAP/SMTP管理邮件的CLI。可在终端使用 `himalaya` 收发、回复、转发、搜索及整理邮件。支持多账户与MML(MIME元语言)编写邮件。"}
★ 68 📥 45,595