smtp-mail-sender-wb

A general-purpose SMTP mail-sending tool that sends plain-text or HTML emails via command-line scripts, supporting multiple recipients and multiple attachments. First-time use requires interactive configuration of the email address and password/authorization code, with credentials stored in the Windows Registry. Built-in SMTP server matching for common providers (e.g., China Telecom, 189, 139, 163, QQ, 126, Outlook, Gmail). Intended for sending emails, reports, or notifications.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "smtp-mail-sender-wb" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-2ddba28284fb62a988a3602d01c55c9d80dca9e66f9019e099ebe4780b9fe2df. Verify the upstream source and version against https://skillhub.cn/skills/user_0d00cdf7/smtp-mail-sender-wb before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

A general-purpose SMTP mail-sending tool that sends plain-text or HTML emails via command-line scripts, supporting multiple recipients and multiple attachments. First-time use requires interactive configuration of the email address and password/authorization code, with credentials stored in the Windows Registry. Built-in SMTP server matching for common providers (e.g., China Telecom, 189, 139, 163, QQ, 126, Outlook, Gmail). Intended for sending emails, reports, or notifications.

0 Downloads

Introduction source: third_party · user_0d00cdf7 · 1.0.0 Reference

SkillPi interpretation

Tasks
Provides general SMTP email sending capability, encapsulated in the `scripts/send_email.py` script. Supports plain text and HTML bodies, multiple recipients, and multiple attachments. First use requires configuring email credentials; thereafter they are read automatically.
Audience
Not specified in the source documentation.
Inputs and outputs
Not specified in the source documentation.
Software, accounts and paid services
Note: using QQ Mail, 163 Mail, etc. requires an authorization code instead of the login password. Guide users to the corresponding mailbox settings page to generate an authorization code.
Limits and differences
Password/authorization code is stored in the Windows registry under `HKCU\Environment`, readable only by the current user. QQ Mail, 163 Mail, etc. use authorization codes rather than login passwords; users should be guided to the mailbox settings page to generate one. Attachment filenames support Chinese and are automatically Base64 encoded. Multiple recipients are sent to one by one, with a separate SMTP connection established for each recipient. The `--check` parameter can be used at any time to check the current configuration status.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: smtp-mail-sender
slug: smtp-mail-sender-wb
version: 1.0.0
displayName: 通用 SMTP 邮件发送工具
description: "通用 SMTP 邮件发送工具。通过命令行脚本发送纯文本或 HTML 邮件,支持多收件人、多附件。首次使用时需交互式配置邮箱地址和密码/授权码,凭据持久化存储在 Windows 注册表中。内置常见邮箱服务商 SMTP 服务器自动匹配(电信、189、139、163、QQ、126、Outlook、Gmail 等)。触发场景:发邮件、发送报告、邮件通知、邮件提醒、定时发送邮件、批量发送邮件、send email、notify、email report、邮件附件、HTML邮件。"
agent_created: true

SMTP 邮件发送工具

Overview

提供通用的 SMTP 邮件发送能力,封装在 scripts/send_email.py 脚本中。支持纯文本和 HTML 正文、多收件人、多附件。首次使用需配置邮箱凭据,后续自动读取。

首次使用 — 配置邮箱凭据

检查是否已配置:

python <skill_dir>/scripts/send_email.py --check

如果输出"尚未配置邮箱凭据",则需引导用户完成配置。有两种方式:

方式一:交互式配置(推荐)

python <skill_dir>/scripts/send_email.py --setup

脚本会提示用户输入邮箱地址和密码/授权码,自动识别 SMTP 服务器,并将凭据持久化到 Windows 注册表 HKCU\Environment。

方式二:手动设置环境变量

setx SMTP_MAIL_ADDR "your_email@domain.com"
setx SMTP_MAIL_PWD "your_password_or_auth_code"

注意:使用 QQ 邮箱、163 邮箱等需使用授权码而非登录密码。引导用户前往对应邮箱设置页面生成授权码。

发送邮件

发送纯文本邮件

python <skill_dir>/scripts/send_email.py \
  --to "person1@example.com,person2@example.com" \
  --subject "邮件主题" \
  --body "邮件正文内容"

发送 HTML 邮件(直接传 HTML 字符串)

python <skill_dir>/scripts/send_email.py \
  --to "person@example.com" \
  --subject "HTML 邮件" \
  --html-body "<h1>标题</h1><p>正文</p>"

发送 HTML 邮件(从 HTML 文件读取)

python <skill_dir>/scripts/send_email.py \
  --to "person@example.com" \
  --subject "报告邮件" \
  --html-file report.html

发送带附件的邮件

python <skill_dir>/scripts/send_email.py \
  --to "person1@example.com,person2@example.com" \
  --subject "带附件的邮件" \
  --body "请查收附件" \
  --attach report.csv \
  --attach data.xlsx

指定发件人显示名称

python <skill_dir>/scripts/send_email.py \
  --to "person@example.com" \
  --subject "邮件" \
  --body "正文" \
  --sender-name "运维团队"

指定自定义 SMTP 服务器

当邮箱域名不在自动匹配列表中时,手动指定:

python <skill_dir>/scripts/send_email.py \
  --to "person@example.com" \
  --subject "邮件" \
  --body "正文" \
  --smtp-server "smtp.example.com" \
  --smtp-port 465 \
  --smtp-mode ssl

在 Python 脚本中直接调用

除了命令行方式,也可在 Python 脚本中导入使用:

import sys
sys.path.insert(0, '<skill_dir>/scripts')
from send_email import send_email

# 检查并引导配置
from send_email import get_credential
addr, pwd = get_credential()
if not addr or not pwd:
    print("邮箱未配置,请运行: python send_email.py --setup")
    sys.exit(1)

# 发送邮件
send_email(
    recipients=['a@b.com', 'c@d.com'],
    subject='邮件主题',
    body='纯文本正文',
    attachments=['report.csv', 'data.xlsx'],
)

发送 HTML 表格邮件示例:

html = '''<html><body style="font-family: Microsoft YaHei, Arial, sans-serif; font-size: 14px;">
<p>各位好,</p>
<table style="border-collapse: collapse; width: 100%; margin: 10px 0;">
<thead><tr style="background-color: #4472C4; color: #fff;">
  <th style="border: 1px solid #ccc; padding: 6px 10px;">名称</th>
  <th style="border: 1px solid #ccc; padding: 6px 10px;">数值</th>
</tr></thead>
<tbody>
<tr style="background-color: #f5f7fa;">
  <td style="border: 1px solid #ddd; padding: 5px 10px;">项目A</td>
  <td style="border: 1px solid #ddd; padding: 5px 10px;">100</td>
</tr>
</tbody></table>
</body></html>'''

send_email(
    recipients='a@b.com,c@d.com',
    subject='数据报告',
    html_body=html,
    attachments=['report.csv'],
)

自动支持的 SMTP 服务器

以下邮箱域名可自动匹配 SMTP 服务器,无需手动指定:

邮箱域名 SMTP 服务器 端口 加密方式
@chinatelecom.cn smtp.chinatelecom.cn 465 SSL
@189.cn smtp.189.cn 465 SSL
@139.com smtp.139.com 465 SSL
@163.com smtp.163.com 465 SSL
@126.com smtp.126.com 465 SSL
@qq.com smtp.qq.com 465 SSL
@foxmail.com smtp.qq.com 465 SSL
@sina.com smtp.sina.com 465 SSL
@sohu.com smtp.sohu.com 465 SSL
@aliyun.com smtp.qiye.aliyun.com 465 SSL
@outlook.com smtp-mail.outlook.com 587 STARTTLS
@hotmail.com smtp-mail.outlook.com 587 STARTTLS
@gmail.com smtp.gmail.com 465 SSL
@yeah.net smtp.yeah.net 465 SSL
@263.net smtp.263.net 465 SSL
@wo.cn smtp.wo.cn 465 SSL

不在列表中的邮箱需通过 --smtp-server、--smtp-port、--smtp-mode 手动指定。

注意事项

  • 密码/授权码存储在 Windows 注册表 HKCU\Environment 下,仅限当前用户可读
  • QQ 邮箱、163 邮箱等使用授权码而非登录密码,需引导用户前往邮箱设置页面生成
  • 附件文件名支持中文,自动进行 Base64 编码
  • 多收件人逐个发送,每收件人单独建立 SMTP 连接
  • --check 参数可随时检查当前配置状态

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 提供通用 SMTP 邮件发送能力,支持纯文本/HTML、多收件人、多附件
  • 内置常见邮箱服务商 SMTP 服务器自动匹配,降低用户使用门槛
  • 解决发邮件、发送报告、邮件通知等高频刚需场景
Trigger Precision95/100

Highlights

  • 触发词覆盖全面,包含中英文变体及具体场景
  • 边界清晰,不易与其他 Skill 重叠
Structure and Standards93/100

Areas to improve

  • description写错位置 Reported severity: Minor

    顶层 frontmatter 中 description 字段为空,实际描述内容在 skill_body 内部

    Recommendation: 建议将 description 内容移至顶层 frontmatter 字段,保持规范统一

Highlights

  • 文档结构完整,步骤清晰,示例丰富
  • 包含首次配置、多种发送方式、Python 调用等完整流程
Execution Reliability88/100

Highlights

  • 工具来源明确,参数设计合理
  • 凭据存储在 Windows 注册表 HKCU\Environment,仅限当前用户可读,安全性良好
  • 覆盖主要异常场景并提供引导
Evidence Verifiability (mean of the first four)92/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Note: using QQ Mail, 163 Mail, etc. requires an authorization code instead of the login password. Guide users to the corresponding mailbox settings page to generate an authorization code.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.