Skip to main content
Home

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

Simple email sending library for Node.js, Deno, Bun, and edge functions

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
a week ago (0.3.1)
function createMessage
createMessage(constructor: MessageConstructor): Message

Creates a new email Message based on the provided constructor parameters. This function provides a more convenient API for creating messages compared to constructing a Message object directly.

Examples

Example 1

const message = createMessage({
  from: "sender@example.com",
  to: "recipient1@example.com",
  subject: "Hello World",
  content: { text: "This is a test message" }
});

Parameters

The constructor parameters for the message. Uses more user-friendly types like accepting strings for email addresses and File objects for attachments.

Return Type

A new Message object with all properties normalized and validated.

Throws

TypeError

When any email address string cannot be parsed or when an attachment object is invalid.

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/core

Import symbol

import { createMessage } from "@upyo/core";
or

Import directly with a jsr specifier

import { createMessage } from "jsr:@upyo/core";

Add Package

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

Import symbol

import { createMessage } from "@upyo/core";

Add Package

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

Import symbol

import { createMessage } from "@upyo/core";

Add Package

vlt install jsr:@upyo/core

Import symbol

import { createMessage } from "@upyo/core";

Add Package

npx jsr add @upyo/core

Import symbol

import { createMessage } from "@upyo/core";

Add Package

bunx jsr add @upyo/core

Import symbol

import { createMessage } from "@upyo/core";