Install
openclaw skills install email-notifierEmail sending and receiving module with multi-provider support (Gmail, Outlook, QQ, custom SMTP). Supports multiple configuration methods (interactive, config file, environment variables). Use for sending alerts, notifications, and checking emails via SMTP/IMAP/POP3.
openclaw skills install email-notifierLightweight, reusable email module with no external dependencies beyond Python standard library.
from scripts.sender import EmailSender
sender = EmailSender(provider="gmail")
sender.send(
to="recipient@example.com",
subject="Alert: System Status",
body="CPU usage is above 90%",
html_body="<h1>Alert</h1><p>CPU usage is <strong>above 90%</strong></p>"
)
from scripts.receiver import EmailReceiver
receiver = EmailReceiver(provider="outlook", mailbox="INBOX")
emails = receiver.fetch_unread(limit=5)
for email in emails:
print(f"From: {email['from']}, Subject: {email['subject']}")
Three methods available, in order of precedence: environment variables > config file > interactive.
Create .env file in the skill directory:
# Provider: gmail, outlook, qq, custom
EMAIL_PROVIDER=gmail
# SMTP Settings
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=your-email@gmail.com
SMTP_PASSWORD=your-app-password
# IMAP Settings (optional, for receiving)
IMAP_SERVER=imap.gmail.com
IMAP_PORT=993
IMAP_USERNAME=your-email@gmail.com
IMAP_PASSWORD=your-app-password
# Default sender (optional)
DEFAULT_FROM=no-reply@gmail.com
Create config.json in the skill directory:
{
"provider": "gmail",
"smtp": {
"server": "smtp.gmail.com",
"port": 587,
"username": "your-email@gmail.com",
"password": "your-app-password"
},
"imap": {
"server": "imap.gmail.com",
"port": 993,
"username": "your-email@gmail.com",
"password": "your-app-password"
}
}
Run the configuration wizard:
python scripts/configurer.py
| Provider | SMTP Server | SMTP Port | IMAP Server | IMAP Port | Notes |
|---|---|---|---|---|---|
| Gmail | smtp.gmail.com | 587 | imap.gmail.com | 993 | Use App Password |
| Outlook | smtp.office365.com | 587 | outlook.office365.com | 993 | Use App Password |
| smtp.qq.com | 465/587 | imap.qq.com | 993 | Use App Password | |
| Custom | your-server | your-port | your-server | your-port | Configure manually |
For Gmail/Outlook/QQ, enable 2FA and generate an App Password instead of using your login password.
| Script | Purpose |
|---|---|
scripts/sender.py | SMTP email sending module |
scripts/receiver.py | IMAP/POP3 email receiving module |
scripts/configurer.py | Interactive configuration wizard |
scripts/validator.py | Test and validate email configuration |
python scripts/configurer.py
This creates a config.json file interactively.
python scripts/validator.py
Tests SMTP connection and IMAP connection (if configured).
from scripts.sender import EmailSender
from scripts.config import load_config
config = load_config()
sender = EmailSender(config=config)
sender.send(
to="admin@example.com",
subject="⚠️ Server Alert",
body=f"Server {hostname} is under high load\nCPU: {cpu}%\nMemory: {mem}%",
priority="high"
)
from scripts.receiver import EmailReceiver
receiver = EmailReceiver(provider="outlook")
unread = receiver.fetch_unread(folder="INBOX", limit=20)
if unread:
summary = f"You have {len(unread)} unread emails"
# Send summary to yourself or dashboard
from scripts.sender import EmailSender
sender = EmailSender(provider="gmail")
recipients = ["user1@example.com", "user2@example.com"]
for recipient in recipients:
sender.send(
to=recipient,
subject="Meeting Reminder",
body="Reminder: Team meeting at 3 PM"
)
用户请求:
服务器 CPU 使用率超过 90%,发邮件告警
处理流程:
email-notifier 技能预期输出:
✅ 已完成:告警邮件发送
📧 收件人:admin@example.com
📝 主题:⚠️ 服务器告警 - CPU 使用率 90%
⏱️ 发送时间:2 秒
成功指标:
用户请求:
把今天的 GitHub 趋势报告发邮件给我
处理流程:
github-analysis-report 生成报告email-notifier 发送报告预期输出:
✅ 已完成:GitHub 报告邮件发送
📧 收件人:2197057577@qq.com
📝 主题:📊 GitHub Trending 每日报告 - 2026-03-08
📎 附件:github-trending-2026-03-08.md
⏱️ 发送时间:3 秒
成功指标:
用户请求:
给团队成员发会议提醒,下午 3 点开会
处理流程:
预期输出:
✅ 已完成:批量会议通知发送
📧 发送数量:10 封
✅ 成功:10 封
❌ 失败:0 封
⏱️ 总耗时:15 秒
成功指标:
| 指标 | 目标值 | 测量方式 |
|---|---|---|
| 邮件发送成功率 | >98% | 成功发送数/总发送数 |
| 平均发送时间 | <5 秒 | 从命令到发送完成时间 |
| 邮件格式正确率 | 100% | HTML/纯文本格式验证 |
| 用户满意度 | >4.5/5 | 用户评分 |
| 配置成功率 | >95% | 首次配置成功数/总配置数 |
skills/email-notifier/sender.py, skills/email-notifier/receiver.pyskills/email-notifier/configurer.pyskills/email-notifier/SKILL.mdGitHub 开发助手,擅长代码审查、PR 管理、Issue 跟踪和仓库自动化。