Skip to main content
Home

@upyo/smtp@0.3.1
Built and signed on GitHub Actions

SMTP transport for Upyo email library

This package works with Node.js, Deno, BunIt is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
a week ago (0.3.1)
method SmtpTransport.prototype.sendMany
SmtpTransport.prototype.sendMany(
messages: Iterable<Message> | AsyncIterable<Message>,
options?: TransportOptions,
): AsyncIterable<Receipt>

Sends multiple email messages efficiently using a single SMTP connection.

This method is optimized for bulk email sending by reusing a single SMTP connection for all messages, which significantly improves performance compared to sending each message individually.

Examples

Example 1

const messages = [
  { subject: 'Message 1', recipients: [{ address: 'user1@example.com' }], ... },
  { subject: 'Message 2', recipients: [{ address: 'user2@example.com' }], ... }
];

for await (const receipt of transport.sendMany(messages)) {
  if (receipt.successful) {
    console.log('Sent:', receipt.messageId);
  } else {
    console.error('Failed:', receipt.errorMessages);
  }
}

Parameters

messages: Iterable<Message> | AsyncIterable<Message>

An iterable or async iterable of messages to send.

optional
options: TransportOptions

Optional transport options including AbortSignal for cancellation.

Return Type

AsyncIterable<Receipt>

An async iterable of receipts, one for each message.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@upyo/smtp

Import symbol

import { SmtpTransport } from "@upyo/smtp";
or

Import directly with a jsr specifier

import { SmtpTransport } from "jsr:@upyo/smtp";

Add Package

pnpm i jsr:@upyo/smtp
or (using pnpm 10.8 or older)
pnpm dlx jsr add @upyo/smtp

Import symbol

import { SmtpTransport } from "@upyo/smtp";

Add Package

yarn add jsr:@upyo/smtp
or (using Yarn 4.8 or older)
yarn dlx jsr add @upyo/smtp

Import symbol

import { SmtpTransport } from "@upyo/smtp";

Add Package

vlt install jsr:@upyo/smtp

Import symbol

import { SmtpTransport } from "@upyo/smtp";

Add Package

npx jsr add @upyo/smtp

Import symbol

import { SmtpTransport } from "@upyo/smtp";

Add Package

bunx jsr add @upyo/smtp

Import symbol

import { SmtpTransport } from "@upyo/smtp";