email-sender
Send emails via SMTP with support for plain text, HTML, and attachments. Use when the user asks to send an email, email someone, or compose and send a message. Supports single recipients and can include file attachments. Works with Gmail, Outlook, Yahoo, QQ Mail, 163 Mail, and any SMTP server.
Permissions
Risk Assessment
This skill requests 3 of 4 possible permissions. Elevated scope — ensure each permission is justified. Consider running in a sandbox.
SKILL.md
Send emails via SMTP with support for text, HTML formatting, and file attachments. Works with Gmail, Outlook, Yahoo, QQ Mail, 163 Mail, and any SMTP server.
Quick Start
Send a simple email:
python3 scripts/send_email.py \
--to [email protected] \
--subject "Meeting Tomorrow" \
--body "Hi, let's meet at 2pm tomorrow."
Send HTML email:
python3 scripts/send_email.py \
--to [email protected] \
--subject "Weekly Report" \
--body "<h1>Report</h1><p>Here are the updates...</p>" \
--html
Send with attachments:
python3 scripts/send_email.py \
--to [email protected] \
--subject "Documents" \
--body "Please find the attached files." \
--attachments report.pdf,data.csv
Setup
One-time configuration required. Create ~/.smtp_config:
{
"host": "smtp.gmail.com",
"port": 587,
"user": "[email protected]",
"password": "your-app-password",
"from": "[email protected]",
"use_ssl": false
}
For Gmail users: Must use App Password (not regular password). See setup.md for detailed instructions on generating app passwords for Gmail, Yahoo, QQ Mail, 163 Mail, and other providers.
Alternatively, use environment variables (see setup.md).
Parameters
--to: Recipient email address (required)--subject: Email subject line (required)--body: Email body content (required)--html: Send as HTML email (optional flag)--attachments: Comma-separated file paths (optional)
Common Patterns
User provides recipient and content
When the user says "email [email protected] about the meeting," extract the recipient and compose appropriate subject/body.
User provides only content
If the user says "send an email saying the report is ready" without specifying a recipient, ask who to send it to.
File attachments
When the user mentions "attach the file" or "send the document," use --attachments with the file path. Multiple files can be separated by commas.
HTML formatting
Use --html when the user wants formatted content (headings, lists, emphasis) or explicitly asks for HTML email.
Error Handling
Missing config: If ~/.smtp_config not found and environment variables not set, the script will print an example config and exit. Guide the user to create the config file with their SMTP settings.
Authentication failed: Usually means incorrect password or need to use app password. Direct user to setup.md for provider-specific instructions.
Missing attachments: Script warns but continues sending email without that attachment.
Connection timeout: Check SMTP host/port settings or network connectivity.
Security
- Credentials stored in
~/.smtp_config(file permissions should be 600) - Or use environment variables for better security
- App passwords recommended over regular passwords
- Config file should not be committed to version control
Why You Need email-sender
Sending emails programmatically usually means setting up a mail service, configuring API keys, and writing template code. For one-off notifications, reports, or alerts from your agent, that setup overhead is not worth it. But sometimes you just need your agent to fire off an email.
Email Sender connects your OpenClaw agent to any SMTP server — Gmail, Outlook, SendGrid, your company mail server, or a self-hosted instance. It supports plain text and HTML emails with attachments. Configure your SMTP credentials once, and your agent can send emails on demand.
Whether you are sending yourself a daily summary, emailing a report to a client, or setting up automated alerts for production issues, Email Sender handles the delivery so your agent can focus on the content.
Common Use Cases
- Send automated daily or weekly summary reports to yourself or your team
- Email generated documents (PDFs, CSVs, reports) as attachments to clients
- Set up production alerts that email the on-call engineer when issues are detected
- Send formatted HTML email notifications for deployment completions or failures
- Automate follow-up emails based on CRM data or lead qualification results
Frequently Asked Questions
Which email providers does it support?
Any provider with SMTP access — Gmail, Outlook/Office 365, SendGrid, Amazon SES, Mailgun, or any self-hosted SMTP server. You configure the SMTP host, port, and credentials.
Can it send HTML emails with formatting?
Yes. It supports both plain text and HTML email bodies. You can send rich formatted emails with headers, tables, links, and inline styling.
Is it secure? How are credentials handled?
SMTP credentials are configured locally in your environment. The skill uses TLS/STARTTLS for secure connections. Credentials are never sent to external services beyond your SMTP server.