send-email
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSend Email
发送邮件
Send emails via SMTP using Python with support for plain text, HTML formatting, file attachments, and template-based emails.
使用Python通过SMTP发送邮件,支持纯文本、HTML格式、文件附件以及基于模板的邮件。
Key Features
核心功能
- Default Sender Email: Automatically uses when no sender is specified
agent_skill_test@126.com - 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
- 默认发件人邮箱:当未指定发件人时,自动使用
agent_skill_test@126.com - 自动Markdown转HTML:检测Markdown内容并将其转换为样式美观的HTML
- 多邮件服务商支持:支持Gmail、Outlook、QQ邮箱、163/126邮箱以及自定义SMTP
- 文件附件:可在邮件中添加多个附件
- 邮件模板:使用模板文件并支持变量替换
Interactive Email Sending Flow
交互式邮件发送流程
This skill guides you through the email sending process step by step.
该工具会引导你逐步完成邮件发送流程。
Step 1: Collect Basic Email Information
步骤1:收集基础邮件信息
Ask the user for the following required information. If any is missing, prompt the user to provide it:
| Information | Description | Example |
|---|---|---|
Recipient ( | Email address to send to | |
Subject ( | Email subject line | |
Content ( | Email body text or HTML | |
IMPORTANT - Default Sender Email Behavior:
If the user does NOT specify a sender email in their initial request, AUTOMATICALLY use as the default sender. DO NOT ask the user which email to send from.
agent_skill_test@126.comOnly ask the user for a different sender email if they explicitly mention wanting to use their own email address.
When using the default , proceed directly to Step 2 and ask for the 126 email authorization code.
agent_skill_test@126.com向用户询问以下必填信息。若有缺失,提示用户补充:
| 信息 | 描述 | 示例 |
|---|---|---|
收件人 ( | 收件人邮箱地址 | |
主题 ( | 邮件主题 | |
内容 ( | 邮件正文文本或HTML | |
重要 - 默认发件人邮箱规则:
如果用户在初始请求中未指定发件人邮箱,自动使用作为默认发件人,无需询问用户使用哪个邮箱发送。
agent_skill_test@126.com仅当用户明确提及想要使用自己的邮箱时,才询问用户提供其他发件人邮箱。
使用默认时,直接进入步骤2,向用户索要126邮箱的授权码。
agent_skill_test@126.comStep 2: Identify Email Provider and Collect Credentials
步骤2:识别邮件服务商并收集凭证
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)@gmail.com, @googlemail.com → Gmail
@outlook.com, @hotmail.com, @live.com, @office365.com → Outlook/Office 365
@qq.com, @vip.qq.com → QQ邮箱
@163.com, @126.com → 网易邮箱
@aliyun.com, @aliyun-inc.com → 阿里云邮箱
@sendgrid.net, @*.sendgrid.net → SendGrid
@*.mailgun.org → Mailgun
其他域名 → 自定义SMTP(需提供服务器、端口、用户名、密码)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: (TLS) or
587(SSL)465 - 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: (TLS)
587 - 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: (TLS) or
587(SSL)465 - 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: (SSL) or
465(IMAP)994 - 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: (SSL) or
465(SSL)25 - 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: (TLS) or
587(SSL)465 - Username: (literally this string)
apikey
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: (TLS)
587 - Username: From Mailgun dashboard
Custom SMTP (Other domains)
Ask the user to provide:
- SMTP Server Address
- SMTP Port
- Username
- Password
Gmail (@gmail.com, @googlemail.com)
- 密码类型:应用专用密码(非账户密码)
- 前提条件:必须启用双因素认证(2FA)
- 如何获取应用专用密码:
- 访问 https://myaccount.google.com/apppasswords
- 登录你的Google账户
- 选择“邮件”和“其他(自定义名称)” → 输入名称如“SMTP脚本”
- 点击“生成” → 复制16位密码
- SMTP服务器:
smtp.gmail.com - 端口:(TLS)或
587(SSL)465 - 用户名:你的完整Gmail邮箱地址
Outlook / Office 365 (@outlook.com, @hotmail.com, @live.com, @office365.com)
- 密码类型:账户密码(与网页登录密码相同)
- SMTP服务器:
smtp.office365.com - 端口:(TLS)
587 - 用户名:你的完整Outlook/Office 365邮箱地址
QQ邮箱 (@qq.com, @vip.qq.com)
- 密码类型:SMTP授权码(非账户密码)
- 如何获取授权码:
- 登录QQ邮箱 https://mail.qq.com
- 点击“设置” → “账户”
- 找到“POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务”
- 开启“POP3/SMTP服务”或“IMAP/SMTP服务”
- 点击“生成授权码”
- 通过短信验证身份 → 复制生成的授权码
- SMTP服务器:
smtp.qq.com - 端口:(TLS)或
587(SSL)465 - 用户名:你的完整QQ邮箱地址
网易163邮箱 (@163.com)
- 密码类型:SMTP授权码(非账户密码)
- 如何获取授权码:
- 登录163邮箱 https://mail.163.com
- 点击“设置” → “POP3/SMTP/IMAP”
- 点击“IMAP/SMTP服务”旁的“开启”
- 验证身份 → 点击“获取授权码”
- 复制16位授权码
- SMTP服务器:
smtp.163.com - 端口:(SSL)或
465(IMAP)994 - 用户名:你的完整163邮箱地址
网易126邮箱 (@126.com)
- 密码类型:SMTP授权码(非账户密码)
- 如何获取授权码:
- 登录126邮箱 https://mail.126.com
- 点击“设置” → “POP3/SMTP/IMAP”
- 启用“IMAP/SMTP服务”
- 复制显示的授权密码
- SMTP服务器:
smtp.126.com - 端口:(SSL)或
465(SSL)25 - 用户名:你的完整126邮箱地址
SendGrid
- 密码类型:API密钥(作为密码使用)
- 如何获取API密钥:
- 登录SendGrid https://app.sendgrid.com
- 进入“设置” → “API密钥”
- 点击“创建API密钥”
- 设置权限 → 点击“创建并查看”
- 复制API密钥(仅显示一次)
- SMTP服务器:
smtp.sendgrid.net - 端口:(TLS)或
587(SSL)465 - 用户名:(固定字符串)
apikey
Mailgun
- 密码类型:控制台中的SMTP凭证
- 如何获取凭证:
- 登录Mailgun https://app.mailgun.com
- 进入“发送” → “域名”
- 选择你的域名
- 复制页面中的SMTP用户名和密码
- SMTP服务器:
smtp.mailgun.org - 端口:(TLS)
587 - 用户名:来自Mailgun控制台
自定义SMTP(其他域名)
向用户询问以下信息:
- SMTP服务器地址
- SMTP端口
- 用户名
- 密码
Step 3: Auto-detect and Handle Markdown Content
步骤3:自动检测并处理Markdown内容
The script automatically detects if the email content is in Markdown format by looking for common patterns:
- Headers (,
#,##)### - Bold/italic text (,
**bold**)*italic* - Lists (or
- item)1. 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 for Markdown content - it's handled automatically!
--content-type html脚本会通过查找常见格式自动检测邮件内容是否为Markdown格式:
- 标题(、
#、##)### - 粗体/斜体文本(、
**粗体**)*斜体* - 列表(或
- 项目)1. 项目 - 代码块(```)
- 链接()
[文本](网址)
如果检测到Markdown格式,内容会自动转换为样式美观的HTML,包含:
- 专业的排版和间距
- 颜色区分的标题
- 样式化的表格和代码块
- 适配邮件客户端的响应式设计
无需手动指定来处理Markdown内容——会自动处理!
--content-type htmlStep 4: Collect Optional Information (if needed)
步骤4:收集可选信息(如需)
- : Display name for sender (e.g., "John Doe")
--from-name - : For HTML formatted emails (defaults to plain text, but auto-converts Markdown)
--content-type html - : File path(s) to attach (can specify multiple)
--attach - : Use template file instead of content
--template - : JSON string of template variables
--template-vars
- :发件人显示名称(例如:“张三”)
--from-name - :用于HTML格式邮件(默认是纯文本,但会自动转换Markdown)
--content-type html - :要附加的文件路径(可指定多个)
--attach - :使用模板文件替代直接输入内容
--template - :模板变量的JSON字符串
--template-vars
Step 5: Confirm and Send
步骤5:确认并发送
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.
发送前,与用户确认:
准备发送:
发件人:[发件人邮箱]
收件人:[收件人邮箱]
主题:[主题]
内容类型:[纯文本/HTML]
附件:[附件列表或无]
是否继续发送?(y/n)若用户确认,使用收集到的所有参数执行send_email.py脚本。
Example Conversations
示例对话
Example 1: Basic Gmail Email
示例1:基础Gmail邮件
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)
用户:给john@example.com发送主题为“Hello”的邮件
工具:我可以帮您发送这封邮件,还需要一些信息:
- 内容:邮件正文应该包含什么?
- 发件人邮箱:应该从哪个邮箱发送?
用户:内容是“Hi John, just saying hello!”,从myemail@gmail.com发送
工具:检测到您使用的是Gmail。Gmail需要应用专用密码(而非常规密码)。
获取应用专用密码的步骤:
- 访问 https://myaccount.google.com/apppasswords
- 登录账户并为“邮件”创建应用专用密码
- 复制16位密码
请提供您的Gmail应用专用密码:
用户:abcd efgh ijkl mnop
工具:准备发送:
- 发件人:myemail@gmail.com
- 收件人:john@example.com
- 主题:Hello
- 内容:Hi John, just saying hello!
是否继续发送?(y/n)
Example 2: Markdown Content with Default Sender
示例2:含Markdown内容的默认发件人邮件
User: 发一封邮件给 manager@company.com,主题是"AR眼镜行业分析",内容是 [用户提供的 Markdown 报告]
Skill: 我来帮您发送这封邮件。检测到您没有指定发件人邮箱,我将使用默认邮箱 发送。
agent_skill_test@126.com同时,我发现您的内容是 Markdown 格式,将自动转换为美观的 HTML 格式,让报告更易读。
为了使用 126 邮箱发送,我需要您提供 SMTP 授权码。
获取授权码步骤:
- 登录 126 邮箱 → 设置 → POP3/SMTP/IMAP
- 启用 "IMAP/SMTP 服务"
- 复制显示的授权密码
请提供 agent_skill_test@126.com 的授权码:
User: [提供授权码]
Skill: 准备发送邮件:
- 发件人: agent_skill_test@126.com
- 收件人: manager@company.com
- 主题: AR眼镜行业分析
- 格式: Markdown → HTML (自动转换)
- 内容预览: 包含标题、列表、表格等格式化内容
确认发送? (y/n)
用户:给manager@company.com发送主题为“AR眼镜行业分析”的邮件,内容是[用户提供的Markdown报告]
工具:我来帮您发送这封邮件。检测到您未指定发件人邮箱,将使用默认邮箱发送。
agent_skill_test@126.com同时,我发现您的内容是Markdown格式,会自动转换为美观的HTML格式,让报告更易读。
为使用126邮箱发送,需要您提供SMTP授权码。
获取授权码步骤:
- 登录126邮箱 → 设置 → POP3/SMTP/IMAP
- 启用“IMAP/SMTP服务”
- 复制显示的授权密码
请提供agent_skill_test@126.com的授权码:
用户:[提供授权码]
工具:准备发送邮件:
- 发件人: agent_skill_test@126.com
- 收件人: manager@company.com
- 主题: AR眼镜行业分析
- 格式: Markdown → HTML(自动转换)
- 内容预览: 包含标题、列表、表格等格式化内容
确认发送?(y/n)
Example 3: Default Sender with Missing Content
示例3:默认发件人且缺失内容的情况
User: 发邮件给 user@company.com,主题是项目报告
Skill: 我需要收集邮件内容:
邮件正文是什么?
User: 项目已完成,所有里程碑都已达成。
Skill: 我将使用默认邮箱 发送。
agent_skill_test@126.com为了使用 126 邮箱发送,我需要您提供 SMTP 授权码。
获取授权码步骤:
- 登录 126 邮箱 → 设置 → POP3/SMTP/IMAP
- 启用 "IMAP/SMTP 服务"
- 复制显示的授权密码
请提供 agent_skill_test@126.com 的授权码:
User: [提供授权码]
Skill: 准备发送邮件:
- 发件人: agent_skill_test@126.com
- 收件人: user@company.com
- 主题: 项目报告
- 内容: 项目已完成,所有里程碑都已达成。
确认发送?(y/n)
用户:给user@company.com发送主题为“项目报告”的邮件
工具:我需要收集邮件内容:
邮件正文是什么?
用户:项目已完成,所有里程碑都已达成。
工具:将使用默认邮箱发送。
agent_skill_test@126.com为使用126邮箱发送,需要您提供SMTP授权码。
获取授权码步骤:
- 登录126邮箱 → 设置 → POP3/SMTP/IMAP
- 启用“IMAP/SMTP服务”
- 复制显示的授权密码
请提供agent_skill_test@126.com的授权码:
用户:[提供授权码]
工具:准备发送邮件:
- 发件人: agent_skill_test@126.com
- 收件人: user@company.com
- 主题: 项目报告
- 内容: 项目已完成,所有里程碑都已达成。
确认发送?(y/n)
Example 4: User Specifies Custom Sender Email
示例4:用户指定自定义发件人邮箱
User: Send a report to boss@company.com from myname@outlook.com about Q4 results, with attachment /home/user/q4_report.pdf
Skill: I'll help you send that email. Please provide the email content:
What should the email say about the Q4 results?
User: Please find attached the Q4 financial report. Let me know if you have any questions.
Skill: I see you're using Outlook. You'll need your Outlook account password (same as web login).
Please provide your Outlook password:
User: mypassword123
Skill: Ready to send:
- From: myname@outlook.com
- To: boss@company.com
- Subject: Q4 results
- Content: Please find attached the Q4 financial report. Let me know if you have any questions.
- Attachment: /home/user/q4_report.pdf
Proceed to send? (y/n)
用户:从myname@outlook.com给boss@company.com发送关于Q4业绩的报告,附件是/home/user/q4_report.pdf
工具:我会帮您发送这封邮件,请提供邮件内容:
关于Q4业绩的邮件内容应该怎么写?
用户:请查收附件中的Q4财务报告,如有疑问请随时告知。
工具:我看到您使用的是Outlook,需要您的Outlook账户密码(与网页登录密码相同)。
请提供您的Outlook密码:
用户:mypassword123
工具:准备发送:
- 发件人: myname@outlook.com
- 收件人: boss@company.com
- 主题: Q4 results
- 内容: Please find attached the Q4 financial report. Let me know if you have any questions.
- 附件: /home/user/q4_report.pdf
是否继续发送?(y/n)
Example 5: Custom SMTP
示例5:自定义SMTP
User: Send email to test@domain.com from my@domain.com
Skill: I need to gather some information:
- Subject: What is the email subject?
- Content: What is the email body?
User: Subject is Test Email, content is Hello World
Skill: Since you're using a custom domain (my@domain.com), I'll need your SMTP configuration:
- SMTP Server: What is your SMTP server address?
- SMTP Port: What port should I use?
- Username: What is your SMTP username?
- Password: What is your SMTP password?
User: Server is smtp.mydomain.com, port 587, username is my@domain.com, password is secret
Skill: Ready to send:
- From: my@domain.com
- To: test@domain.com
- Subject: Test Email
- Content: Hello World
- SMTP Server: smtp.mydomain.com:587
Proceed to send? (y/n)
用户:从my@domain.com给test@domain.com发送邮件
工具:我需要收集一些信息:
- 主题:邮件主题是什么?
- 内容:邮件正文是什么?
用户:主题是Test Email,内容是Hello World
工具:由于您使用的是自定义域名(my@domain.com),需要您提供SMTP配置信息:
- SMTP服务器:您的SMTP服务器地址是什么?
- SMTP端口:应该使用哪个端口?
- 用户名:您的SMTP用户名是什么?
- 密码:您的SMTP密码是什么?
用户:服务器是smtp.mydomain.com,端口587,用户名是my@domain.com,密码是secret
工具:准备发送:
- 发件人: my@domain.com
- 收件人: test@domain.com
- 主题: Test Email
- 内容: Hello World
- SMTP服务器: smtp.mydomain.com:587
是否继续发送?(y/n)
Script Command Reference
脚本命令参考
Once all information is collected, execute the script with appropriate parameters:
收集完所有信息后,使用相应参数执行脚本:
Basic Command
基础命令
bash
python3 scripts/send_email.py \
--to recipient@example.com \
--subject "Email Subject" \
--content "Email body content" \
--smtp-server smtp.gmail.com \
--smtp-port 587 \
--username your@email.com \
--password your-password-or-app-passwordbash
python3 scripts/send_email.py \
--to recipient@example.com \
--subject "Email Subject" \
--content "Email body content" \
--smtp-server smtp.gmail.com \
--smtp-port 587 \
--username your@email.com \
--password your-password-or-app-passwordHTML Email
HTML格式邮件
bash
python3 scripts/send_email.py \
--to recipient@example.com \
--subject "Email Subject" \
--content "<h1>Hello</h1><p>HTML content</p>" \
--content-type html \
--smtp-server smtp.gmail.com \
--smtp-port 587 \
--username your@email.com \
--password your-passwordbash
python3 scripts/send_email.py \
--to recipient@example.com \
--subject "Email Subject" \
--content "<h1>Hello</h1><p>HTML content</p>" \
--content-type html \
--smtp-server smtp.gmail.com \
--smtp-port 587 \
--username your@email.com \
--password your-passwordEmail with Attachments
带附件的邮件
bash
python3 scripts/send_email.py \
--to recipient@example.com \
--subject "Email Subject" \
--content "Email body" \
--attach /path/to/file1.pdf \
--attach /path/to/file2.csv \
--smtp-server smtp.gmail.com \
--smtp-port 587 \
--username your@email.com \
--password your-passwordbash
python3 scripts/send_email.py \
--to recipient@example.com \
--subject "Email Subject" \
--content "Email body" \
--attach /path/to/file1.pdf \
--attach /path/to/file2.csv \
--smtp-server smtp.gmail.com \
--smtp-port 587 \
--username your@email.com \
--password your-passwordEmail with Template
使用模板的邮件
bash
python3 scripts/send_email.py \
--to recipient@example.com \
--subject "Email Subject" \
--template assets/simple-notification.html \
--template-vars '{"title":"Notification","message":"Your report is ready!"}' \
--content-type html \
--smtp-server smtp.gmail.com \
--smtp-port 587 \
--username your@email.com \
--password your-passwordbash
python3 scripts/send_email.py \
--to recipient@example.com \
--subject "Email Subject" \
--template assets/simple-notification.html \
--template-vars '{"title":"Notification","message":"Your report is ready!"}' \
--content-type html \
--smtp-server smtp.gmail.com \
--smtp-port 587 \
--username your@email.com \
--password your-passwordSSL Connection (instead of TLS)
SSL连接(替代TLS)
bash
python3 scripts/send_email.py \
--to recipient@example.com \
--subject "Email Subject" \
--content "Email body" \
--smtp-server smtp.gmail.com \
--smtp-port 465 \
--use-ssl \
--username your@email.com \
--password your-passwordbash
python3 scripts/send_email.py \
--to recipient@example.com \
--subject "Email Subject" \
--content "Email body" \
--smtp-server smtp.gmail.com \
--smtp-port 465 \
--use-ssl \
--username your@email.com \
--password your-passwordSMTP Server Configuration Reference
SMTP服务器配置参考
| Provider | SMTP Server | Port | Encryption | Password Type | Username |
|---|---|---|---|---|---|
| Gmail | smtp.gmail.com | 587 | TLS | App Password | Full email |
| Gmail | smtp.gmail.com | 465 | SSL | App Password | Full email |
| Outlook | smtp.office365.com | 587 | TLS | Account Password | Full email |
| QQ Mail | smtp.qq.com | 587 | TLS | Authorization Code | Full email |
| QQ Mail | smtp.qq.com | 465 | SSL | Authorization Code | Full email |
| 163 Mail | smtp.163.com | 465 | SSL | Authorization Code | Full email |
| 163 Mail | smtp.163.com | 994 | SSL | Authorization Code | Full email |
| 126 Mail | smtp.126.com | 465 | SSL | Authorization Code | Full email |
| 126 Mail | smtp.126.com | 25 | SSL | Authorization Code | Full email |
| SendGrid | smtp.sendgrid.net | 587 | TLS | API Key | |
| SendGrid | smtp.sendgrid.net | 465 | SSL | API Key | |
| Mailgun | smtp.mailgun.org | 587 | TLS | SMTP Password | From dashboard |
| 服务商 | SMTP服务器 | 端口 | 加密方式 | 密码类型 | 用户名 |
|---|---|---|---|---|---|
| Gmail | smtp.gmail.com | 587 | TLS | 应用专用密码 | 完整邮箱 |
| Gmail | smtp.gmail.com | 465 | SSL | 应用专用密码 | 完整邮箱 |
| Outlook | smtp.office365.com | 587 | TLS | 账户密码 | 完整邮箱 |
| QQ邮箱 | smtp.qq.com | 587 | TLS | 授权码 | 完整邮箱 |
| QQ邮箱 | smtp.qq.com | 465 | SSL | 授权码 | 完整邮箱 |
| 163邮箱 | smtp.163.com | 465 | SSL | 授权码 | 完整邮箱 |
| 163邮箱 | smtp.163.com | 994 | SSL | 授权码 | 完整邮箱 |
| 126邮箱 | smtp.126.com | 465 | SSL | 授权码 | 完整邮箱 |
| 126邮箱 | smtp.126.com | 25 | SSL | 授权码 | 完整邮箱 |
| SendGrid | smtp.sendgrid.net | 587 | TLS | API密钥 | |
| SendGrid | smtp.sendgrid.net | 465 | SSL | API密钥 | |
| Mailgun | smtp.mailgun.org | 587 | TLS | SMTP密码 | 来自控制台 |
Installation
安装
Before using this skill, install the required Python dependencies:
bash
pip install -r requirements.txtThis installs the library (version ≥3.4.0) which is required for automatic Markdown to HTML conversion.
markdown使用该工具前,安装所需的Python依赖:
bash
pip install -r requirements.txt这会安装库(版本≥3.4.0),用于自动将Markdown转换为HTML。
markdownResources
资源说明
scripts/send_email.py
scripts/send_email.py
Main Python script for sending emails. Supports:
- Plain text and HTML content
- Multiple file attachments
- Email templates with variable substitution
- TLS and SSL encryption
- Custom sender names
用于发送邮件的主Python脚本,支持:
- 纯文本和HTML内容
- 多个文件附件
- 带变量替换的邮件模板
- TLS和SSL加密
- 自定义发件人名称
references/smtp-servers.md
references/smtp-servers.md
Common SMTP server configurations including Gmail, Outlook, 126, QQ, 163, SendGrid, Mailgun, and Aliyun.
常见SMTP服务器配置,包括Gmail、Outlook、126、QQ、163、SendGrid、Mailgun和阿里云邮箱。
assets/
assets/
Email templates:
- - Basic notification template
simple-notification.html - - Professional report template with metrics grid
report-summary.html
邮件模板:
- - 基础通知模板
simple-notification.html - - 带指标网格的专业报告模板
report-summary.html