Send Email
Send emails via SMTP with support for HTML formatting, file attachments, and email templates. Use when users ask to: (1) Send an email, (2) Email someone, (3) Send a notification, (4) Use email templates, or (5) Send files via email.
- Skill ID
- wangyendt/wayne-skills/send-email
- Publisher
- wangyendt
- Repository
- wayne-skills
- Installs
- 0
- Files
- 6
- Synced
- Sep 23, 2026
Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.
wangyendt/wayne-skills/send-emailInstalls these files- SKILL.md
- assets/report-summary.html
- assets/simple-notification.html
- references/smtp-servers.md
- requirements.txt
- scripts/send_email.py
What this skill tells the agent
Send Email
Send emails via SMTP using Python with support for plain text, HTML formatting, file attachments, and template-based emails.
Key Features
- Default Sender Email: Automatically uses
agent_skill_test@126.comwhen no sender is specified - Automatic Markdown to HTML: Detects Markdown content and converts to beautifully styled HTML
- Multiple Email Providers: Supports Gmail, Outlook, QQ Mail, 163/126 Mail, and custom SMTP
- File Attachments: Attach multiple files to emails
- Email Templates: Use template files with variable substitution
Interactive Email Sending Flow
This skill guides you through the email sending process step by step.
Step 1: Collect Basic Email Information
Ask the user for the following required information. If any is missing, prompt the user to provide it:
| Information | Description | Example |
|---|---|---|
Recipient (--to) | Email address to send to | user@example.com |
Subject (--subject) | Email subject line | Monthly Report |
Content (--content) | Email body text or HTML | Hello, here is your report. |
IMPORTANT - Default Sender Email Behavior:
If the user does NOT specify a sender email in their initial request, AUTOMATICALLY use `agent_skill_test@126.com` as the default sender. DO NOT ask the user which email to send from.
Only ask the user for a different sender email if they explicitly mention wanting to use their own email address.
When using the default agent_skill_test@126.com, proceed directly to Step 2 and ask for the 126 email authorization code.
Step 2: Identify Email Provider and Collect Credentials
Based on the sender's email address domain, identify the email provider and request the appropriate credentials.
Email Provider Detection
@gmail.com, @googlemail.com → Gmail
@outlook.com, @hotmail.com, @live.com, @office365.com → Outlook/Office 365
@qq.com, @vip.qq.com → QQ Mail
@163.com, @126.com → NetEase Mail
@aliyun.com, @aliyun-inc.com → Aliyun Mail
@sendgrid.net, @*.sendgrid.net → SendGrid
@*.mailgun.org → Mailgun
Other domains → Custom SMTP (ask for server, port, username, password)Provider-Specific Credential Requirements
Gmail (@gmail.com, @googlemail.com)
- Password Type: App Password (NOT account password)
- Prerequisite: Two-factor authentication (2FA) must be enabled
- How to get App Password:
- Go to https://myaccount.google.com/apppasswords
- Sign in to your Google Account
- Select "Mail" and "Other (Custom name)" → Enter a name like "SMTP Script"
- Click "Generate" → Copy the 16-character password
- SMTP Server:
smtp.gmail.com - Port:
587(TLS) or465(SSL) - Username: Your full Gmail address
Outlook / Office 365 (@outlook.com, @hotmail.com, @live.com, @office365.com)
- Password Type: Account password (same as web login)
- SMTP Server:
smtp.office365.com - Port:
587(TLS) - Username: Your full Outlook/Office 365 email address
QQ Mail (@qq.com, @vip.qq.com)
- Password Type: SMTP Authorization Code (NOT account password)
- How to get Authorization Code:
- Login to QQ Mail at https://mail.qq.com
- Click "Settings" (设置) → "Account" (账户)
- Find "POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV Service"
- Open "POP3/SMTP Service" or "IMAP/SMTP Service"
- Click "Generate Authorization Code" (生成授权码)
- Verify identity via SMS → Copy the generated code
- SMTP Server:
smtp.qq.com - Port:
587(TLS) or465(SSL) - Username: Your full QQ email address
NetEase 163 Mail (@163.com)
- Password Type: SMTP Authorization Code (NOT account password)
- How to get Authorization Code:
- Login to 163 Mail at https://mail.163.com
- Click "Settings" (设置) → "POP3/SMTP/IMAP"
- Click "Open" next to "IMAP/SMTP Service"
- Verify identity → Click "Get Authorization Code" (获取授权码)
- Copy the 16-character authorization code
- SMTP Server:
smtp.163.com - Port:
465(SSL) or994(IMAP) - Username: Your full 163 email address
NetEase 126 Mail (@126.com)
- Password Type: SMTP Authorization Code (NOT account password)
- How to get Authorization Code:
- Login to 126 Mail at https://mail.126.com
- Click "Settings" (设置) → "POP3/SMTP/IMAP"
- Enable "IMAP/SMTP Service"
- Copy the authorization password displayed
- SMTP Server:
smtp.126.com - Port:
465(SSL) or25(SSL) - Username: Your full 126 email address
SendGrid
- Password Type: API Key (as password)
- How to get API Key:
- Login to SendGrid at https://app.sendgrid.com
- Go to Settings → API Keys
- Click "Create API Key"
- Set permissions → Click "Create & View"
- Copy the API key (only shown once)
- SMTP Server:
smtp.sendgrid.net - Port:
587(TLS) or465(SSL) - Username:
apikey(literally this string)
Mailgun
- Password Type: SMTP credentials from dashboard
- How to get Credentials:
- Login to Mailgun at https://app.mailgun.com
- Go to Sending → Domains
- Select your domain
- Copy SMTP username and password from the page
- SMTP Server:
smtp.mailgun.org - Port:
587(TLS) - Username: From Mailgun dashboard
Custom SMTP (Other domains) Ask the user to provide:
- SMTP Server Address
- SMTP Port
- Username
- Password
Step 3: Auto-detect and Handle Markdown Content
The script automatically detects if the email content is in Markdown format by looking for common patterns:
- Headers (
#,##,###) - Bold/italic text (
**bold**,*italic*) - Lists (
- itemor1. item) - Code blocks (```)
- Links (
[text](url))
If Markdown is detected, the content is automatically converted to beautifully styled HTML with:
- Professional typography and spacing
- Color-coded headers
- Styled tables and code blocks
- Responsive design for email clients
You don't need to manually specify `--content-type html` for Markdown content - it's handled automatically!
Step 4: Collect Optional Information (if needed)
--from-name: Display name for sender (e.g., "John Doe")--content-type html: For HTML formatted emails (defaults to plain text, but auto-converts Markdown)--attach: File path(s) to attach (can specify multiple)--template: Use template file instead of content--template-vars: JSON string of template variables
Step 5: Confirm and Send
Before sending, confirm with the user:
Ready to send:
From: [Sender Email]
To: [Recipient Email]
Subject: [Subject]
Content Type: [Plain/HTML]
Attachments: [List of attachments or None]
Proceed to send? (y/n)If confirmed, execute the send_email.py script with all collected parameters.
Example Conversations
Example 1: Basic Gmail Email
User: Send an email to john@example.com with subject "Hello"
Skill: I can help you send that email. I need a few more details:
- Content: What should the email body contain?
- Sender Email: What email address should I send from?
User: The content is "Hi John, just saying hello!" and send from myemail@gmail.com
Skill: I detected you're using Gmail. For Gmail, you need an App Password (not your regular password).
To get your App Password:
- Go to https://myaccount.google.com/apppasswords
- Sign in and create an App Password for "Mail"
- Copy the 16-character password
Please provide your Gmail App Password:
User: abcd efgh ijkl mnop
Skill: Ready to send:
- From: myemail@gmail.com
- To: john@example.com
- Subject: Hello
- Content: Hi John, just saying hello!
Proceed to send? (y/n)
Example 2: Markdown Content with Default Sender
User: 发一封邮件给 manager@company.com,主题是"AR眼镜行业分析",内容是 [用户提供的 Markdown 报告]
Skill: 我来帮您发送这封邮件。检测到您没有指定发件人邮箱,我将使用默认邮箱 agent_skill_test@126.com 发送。
同时,我发现您的内容是 Markdown 格式,将自动转换为美观的 HTML 格式,让报告更易读。
Use this skill in a project
Open any RiverX project, search the Skills panel for wangyendt/wayne-skills/send-email, and install it in one click.
