npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

koishi-plugin-email-sender

v1.0.3

Published

Koishi 邮件发送插件,支持多收件人、HTML格式和附件

Readme

koishi-plugin-email-sender

npm

Koishi 邮件发送插件,支持通过命令发送邮件,包括多收件人、HTML格式和附件功能。

功能特点

  • 支持发送纯文本或 HTML 格式邮件
  • 支持多个收件人(收件人、抄送、密送)
  • 支持添加附件
  • 支持自定义发件人名称
  • 支持邮件主题设置
  • 完整的权限控制

安装

# 使用 npm
npm install koishi-plugin-email-sender

# 使用 yarn
yarn add koishi-plugin-email-sender

# 使用 pnpm
pnpm add koishi-plugin-email-sender

配置

在 Koishi 配置文件中添加以下配置:

export default {
  plugins: {
    'email-sender': {
      // SMTP 服务器地址
      host: 'smtp.example.com',
      // SMTP 服务器端口
      port: 465,
      // 是否使用 SSL/TLS
      secure: true,
      // 发件人邮箱
      auth: {
        user: '[email protected]',
        pass: 'your-password-or-app-password'
      },
      // 默认发件人名称(可选)
      senderName: 'Koishi Bot',
      // 命令名称(可选,默认为 email)
      commandName: 'email',
      // 权限等级(可选,默认为 3)
      authority: 3
    }
  }
}

配置说明

| 配置项 | 类型 | 默认值 | 说明 | |-------|------|-------|------| | host | string | - | SMTP 服务器地址 | | port | number | 465 | SMTP 服务器端口 | | secure | boolean | true | 是否使用 SSL/TLS | | auth.user | string | - | 发件人邮箱地址 | | auth.pass | string | - | 发件人邮箱密码或应用专用密码 | | senderName | string | 'Koishi Bot' | 默认发件人名称 | | commandName | string | 'email' | 命令名称 | | authority | number | 3 | 命令权限等级 |

使用方法

基本用法

发送一封简单的邮件:

email send to:[email protected] subject:"测试邮件" 这是邮件内容

高级用法

发送带有 HTML 内容、多个收件人和附件的邮件:

email send to:[email protected],[email protected] cc:[email protected] bcc:[email protected] subject:"HTML测试邮件" --html "<h1>这是一个HTML邮件</h1><p>支持<b>富文本</b>格式</p>" --attach /path/to/file.pdf

参数说明

| 参数 | 说明 | |------|------| | to | 收件人邮箱,多个收件人用逗号分隔 | | cc | 抄送邮箱,多个抄送用逗号分隔 | | bcc | 密送邮箱,多个密送用逗号分隔 | | subject | 邮件主题 | | --html | 使用 HTML 格式发送邮件内容 | | --attach | 添加附件,支持本地文件路径 | | --from | 自定义发件人名称(可选) |

注意事项

  1. 对于 Gmail 等启用了两步验证的邮箱,需要使用应用专用密码而非账户密码
  2. 确保 SMTP 服务器允许第三方应用访问
  3. 发送大型附件可能受到邮件服务商的限制
  4. 命令权限默认为 3 级,可以在配置中调整

示例

发送纯文本邮件

email send to:[email protected] subject:"会议通知" 明天下午3点在会议室A开会,请准时参加。

发送 HTML 格式邮件

email send to:[email protected] subject:"HTML邮件测试" --html "<h1>标题</h1><p>这是<b>加粗</b>文本</p><a href='https://koishi.chat'>Koishi官网</a>"

发送带附件的邮件

email send to:[email protected] subject:"附件测试" 请查收附件 --attach /home/user/documents/report.pdf

发送给多个收件人

email send to:[email protected],[email protected] cc:[email protected] subject:"团队通知" 这是发送给多人的邮件

许可证

MIT