简介
原始描述
Email management and automation. Send, read, search, and organize emails across multiple providers.
通过你的 Agent 添加
安装目录:email/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: email
description: Email management and automation. Send, read, search, and organize emails across multiple providers.
metadata: {"clawdbot":{"emoji":"📧","always":true,"requires":{"bins":["python3"]}}}
Email 📧
Email management and automation with attachment support.
Features
- Send emails with attachments
- Support for multiple email providers (Gmail, Outlook, Yahoo, etc.)
- HTML and plain text email support
- CC and BCC recipients
- Test email functionality
- Secure TLS/SSL connections
Setup Instructions
1. Configure Email Credentials
1. Configure Email Credentials
Create a configuration file email_config.json in your workspace:
{
"smtp_server": "smtp.gmail.com",
"smtp_port": 587,
"username": "your-email@gmail.com",
"password": "your-app-password",
"sender_name": "OpenClaw Assistant",
"use_tls": true,
"use_ssl": false
}
2. For Gmail Users (Recommended)
- Enable 2-factor authentication on your Google account
- Generate an App Password:
- Go to https://myaccount.google.com/security
- Under "Signing in to Google," select "App passwords"
- Generate a new app password for "Mail"
- Use this 16-character password in your config
3. Alternative: Environment Variables
- Go to https://myaccount.google.com/security
- Under "Signing in to Google," select "App passwords"
- Generate a new app password for "Mail"
- Use this 16-character password in your config
Set these environment variables instead of using a config file:
# Windows
set SMTP_SERVER=smtp.gmail.com
set SMTP_PORT=587
set EMAIL_USERNAME=your-email@gmail.com
set EMAIL_PASSWORD=your-app-password
set EMAIL_SENDER_NAME="OpenClaw Assistant"
# macOS/Linux
export SMTP_SERVER=smtp.gmail.com
export SMTP_PORT=587
export EMAIL_USERNAME=your-email@gmail.com
export EMAIL_PASSWORD=your-app-password
export EMAIL_SENDER_NAME="OpenClaw Assistant"
Usage Examples
Send a Simple Email
python email_sender.py --to "recipient@example.com" --subject "Hello" --body "This is a test email"
Send Email with Attachment
python email_sender.py --to "recipient@example.com" --subject "Report" --body "Please find attached" --attachment "report.pdf" --attachment "data.xlsx"
Send Test Email
python email_sender.py --to "your-email@gmail.com" --test
Using with OpenClaw Commands
"Send email to recipient@example.com with subject Meeting Notes and body Here are the notes from today's meeting"
"Send test email to verify configuration"
"Email the report.pdf file to team@company.com"
Supported Email Providers
Provider
SMTP Server
Port
TLS
Gmail
smtp.gmail.com
587
Yes
Outlook/Office365
smtp.office365.com
587
Yes
Yahoo
smtp.mail.yahoo.com
587
Yes
QQ Mail
smtp.qq.com
587
Yes
Custom SMTP
your.smtp.server.com
587/465
As configured
Python API Usage
from email_sender import EmailSender
# Initialize with config file
sender = EmailSender("email_config.json")
# Send email with attachment
result = sender.send_email(
to_email="recipient@example.com",
subject="Important Document",
body="Please review the attached document.",
attachments=["document.pdf", "data.csv"]
)
if result["success"]:
print(f"Email sent with {result['attachments']} attachments")
else:
print(f"Error: {result['error']}")
Troubleshooting
Common Issues:
-
Authentication Failed
- Verify your username and password
- For Gmail: Use app password instead of regular password
- Check if 2FA is enabled
-
Connection Refused
- Verify SMTP server and port
- Check firewall settings
- Try different port (465 for SSL)
-
Attachment Too Large
- Most providers limit attachments to 25MB
- Consider compressing files or using cloud storage links
Security Notes
- Never commit email credentials to version control
- Use environment variables for production deployments
- Regularly rotate app passwords
- Consider using dedicated email accounts for automation
python email_sender.py --to "recipient@example.com" --subject "Report" --body "Please find attached" --attachment "report.pdf" --attachment "data.xlsx"
python email_sender.py --to "your-email@gmail.com" --test
Using with OpenClaw Commands
"Send email to recipient@example.com with subject Meeting Notes and body Here are the notes from today's meeting"
"Send test email to verify configuration"
"Email the report.pdf file to team@company.com"
Supported Email Providers
Provider
SMTP Server
Port
TLS
Gmail
smtp.gmail.com
587
Yes
Outlook/Office365
smtp.office365.com
587
Yes
Yahoo
smtp.mail.yahoo.com
587
Yes
QQ Mail
smtp.qq.com
587
Yes
Custom SMTP
your.smtp.server.com
587/465
As configured
Python API Usage
from email_sender import EmailSender
# Initialize with config file
sender = EmailSender("email_config.json")
# Send email with attachment
result = sender.send_email(
to_email="recipient@example.com",
subject="Important Document",
body="Please review the attached document.",
attachments=["document.pdf", "data.csv"]
)
if result["success"]:
print(f"Email sent with {result['attachments']} attachments")
else:
print(f"Error: {result['error']}")
Troubleshooting
Common Issues:
-
Authentication Failed
- Verify your username and password
- For Gmail: Use app password instead of regular password
- Check if 2FA is enabled
-
Connection Refused
- Verify SMTP server and port
- Check firewall settings
- Try different port (465 for SSL)
-
Attachment Too Large
- Most providers limit attachments to 25MB
- Consider compressing files or using cloud storage links
Security Notes
- Never commit email credentials to version control
- Use environment variables for production deployments
- Regularly rotate app passwords
- Consider using dedicated email accounts for automation
"Send email to recipient@example.com with subject Meeting Notes and body Here are the notes from today's meeting"
"Send test email to verify configuration"
"Email the report.pdf file to team@company.com"
| Provider | SMTP Server | Port | TLS |
|---|---|---|---|
| Gmail | smtp.gmail.com | 587 | Yes |
| Outlook/Office365 | smtp.office365.com | 587 | Yes |
| Yahoo | smtp.mail.yahoo.com | 587 | Yes |
| QQ Mail | smtp.qq.com | 587 | Yes |
| Custom SMTP | your.smtp.server.com | 587/465 | As configured |
Python API Usage
from email_sender import EmailSender
# Initialize with config file
sender = EmailSender("email_config.json")
# Send email with attachment
result = sender.send_email(
to_email="recipient@example.com",
subject="Important Document",
body="Please review the attached document.",
attachments=["document.pdf", "data.csv"]
)
if result["success"]:
print(f"Email sent with {result['attachments']} attachments")
else:
print(f"Error: {result['error']}")
Troubleshooting
Common Issues:
-
Authentication Failed
- Verify your username and password
- For Gmail: Use app password instead of regular password
- Check if 2FA is enabled
-
Connection Refused
- Verify SMTP server and port
- Check firewall settings
- Try different port (465 for SSL)
-
Attachment Too Large
- Most providers limit attachments to 25MB
- Consider compressing files or using cloud storage links
Security Notes
- Never commit email credentials to version control
- Use environment variables for production deployments
- Regularly rotate app passwords
- Consider using dedicated email accounts for automation
from email_sender import EmailSender
# Initialize with config file
sender = EmailSender("email_config.json")
# Send email with attachment
result = sender.send_email(
to_email="recipient@example.com",
subject="Important Document",
body="Please review the attached document.",
attachments=["document.pdf", "data.csv"]
)
if result["success"]:
print(f"Email sent with {result['attachments']} attachments")
else:
print(f"Error: {result['error']}")
Common Issues:
Authentication Failed
- Verify your username and password
- For Gmail: Use app password instead of regular password
- Check if 2FA is enabled
Connection Refused
- Verify SMTP server and port
- Check firewall settings
- Try different port (465 for SSL)
Attachment Too Large
- Most providers limit attachments to 25MB
- Consider compressing files or using cloud storage links
- Never commit email credentials to version control
- Use environment variables for production deployments
- Regularly rotate app passwords
- Consider using dedicated email accounts for automation
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。