@antelopejs/nodemailer

中文文档
0.0.8发布于 2026/11/04Apache-2.0TypeScriptCommonJS构建来源已验证近 30 天下载 3947

AntelopeJS 的 SMTP 电子邮件模块, 执行与节点邮件器的电子邮件接口

中文使用文档
文档目录8 节
  1. 接口
  2. 安装
  3. 配置
  4. 快开始
  5. 文档
  6. 兼容性
  7. 捐款
  8. 许可证

@antelopejs/nodemailer

npm License Discord Documentation

羚羊JS节点邮件模块通过SMTP发送电子邮件界面的信息 节点。 。 。 .

接口

接口文档
@antelopejs/interface-email电子邮件

模块执行 Send, (中文(简体) ), SendBatch, (中文(简体) ), SendTemplate,以及 GetCapabilities它支持内置模板、附件, replyTo以及优先事项。 它不支持提供者托管的模板,所以 SendTemplate 带有模板 ID 返回 a NOT_SUPPORTED 错误.

安装

ajs project modules add @antelopejs/nodemailer

模块没有默认配置 。 添加一个 config 在项目开始前设置块.

配置

import { defineConfig } from "@antelopejs/interface-core/config";

export default defineConfig({
  name: "my-project",
  modules: {
    nodemailer: {
      source: {
        type: "package",
        package: "@antelopejs/nodemailer",
        version: "^0.0.7",
      },
      config: {
        host: "smtp.example.com",
        port: 587,
        secure: false,
        auth: { user: "smtp-user", pass: "smtp-password" },
        defaults: { from: "[email protected]" },
      },
    },
  },
  envOverrides: {
    SMTP_PASSWORD: "modules.nodemailer.config.auth.pass",
  },
});
密钥说明
hostSMTP主机. 要求,除非 ethereal 实值 true。 。 。 .
portSMTP端口,作为数字. 要求,除非 ethereal 实值 true。 。 。 .
secure从连接开始使用 TLS 。 默认为 true 第465和465号港口 false 否则.
requireTLS需要STARTLS系统. 默认为 true 何时 auth 设置和 secure 决定: false设置为 false 以允许清晰文本认证.
auth可选 SMTP 证书, { user, pass }。两者在设定时都必须是非空的.
defaults.from当信件没有时使用发送器 from。 。 。 .
ethereal设定为 true 开发中发送临时 爱丽丝 账户.

与 ethereal: true,模块忽略了其他密钥,在启动时创建一个账户,登录其地址并将其作为默认发送者. 每个发送的信件都会在您可以读取的地方登录一个预览 URL.

快开始

在发送电子邮件的模块中,添加接口:

pnpm add @antelopejs/interface-email
import { Send } from "@antelopejs/interface-email";

const result = await Send({
  to: "[email protected]",
  subject: "Welcome",
  text: "Your account is ready.",
  html: "<p>Your account is ready.</p>",
});

result.success 告诉您 SMTP 服务器是否接受信件 。 如果失败了, result.error 保存错误代码和消息.

文档

  • 电子邮件页:1 @antelopejs/interface-email 与本模块设备订约.
  • 配置: 模块来源, config 区块和配置变量 antelope.config.ts。 。 。 .

兼容性

软件包支助测试过
@antelopejs/interface-core>=0.2.4 <1.0.00.2.4
@antelopejs/interface-email>=0.1.0 <0.2.00.1.0

捐款

使用节点版本 .nvmrc 和 pnpm 版本在 packageManager 领域 package.json数字 :

pnpm install
pnpm dev            # run the playground/ project with an Ethereal account
pnpm lint
pnpm format:check
pnpm knip
pnpm test           # build, then ajs module test

读取 捐款准则 在打开拉出请求之前.

许可证

阿帕奇 - 2.0

版本与发布记录

@antelopejs/nodemailer 共发布 7 个版本,首次发布于 2026/03/24;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.0.8latest2026/11/041 天前
0.0.72026/11/024 天前
0.0.62026/10/1720 天前
0.0.52026/09/161 个月前
0.0.42026/08/212 个月前
0.0.32026/06/164 个月前

关于 @antelopejs/nodemailer 的常见问题

@antelopejs/nodemailer 是什么?

AntelopeJS 的 SMTP 电子邮件模块, 执行与节点邮件器的电子邮件接口

如何安装 @antelopejs/nodemailer?

在项目目录运行 npm install @antelopejs/nodemailer,或使用 pnpm add / yarn add / bun add。

@antelopejs/nodemailer 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@antelopejs/nodemailer 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@antelopejs/nodemailer 可以商用吗?

@antelopejs/nodemailer 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@antelopejs/nodemailer 的下载量有多少?

根据 npm 官方下载统计,@antelopejs/nodemailer 在 2026/10/06 – 2026/11/04 这 30 天内被下载 3,947 次,日均约 132 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@antelopejs/nodemailer 还在维护吗?

最新版本 0.0.8 发布于 2026/11/04(1 天前);至今共发布 7 个版本,其中过去 12 个月发布了 7 个;首次发布于 2026/03/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。