mailmessage
v0.1.0
Published
Portable, provider-neutral email message primitives.
Readme
mailmessage
Portable, provider-neutral email message primitives.
mailmessage defines the shared message value consumed by composition, delivery, and transport packages. It owns addresses, recipients, bodies, headers, attachment metadata, and application metadata; it does not send mail.
Install
npm i mailmessageimport { createMailMessage } from "mailmessage";
const message = createMailMessage({
from: { email: "[email protected]", name: "Mosa" },
to: ["[email protected]"],
subject: "Welcome",
text: "Hello from Mosa.",
});Architecture
mailmessage
portable message model
│
▼
emailflow / mailoutbox / transportcoreAPI
MailMessage supports from, to, optional cc, bcc, and replyTo, a subject, plain-text and/or HTML bodies, string headers, attachment metadata, and application metadata. Recipients may be email strings or { email, name } objects. parseMailMessage validates untrusted input.
Non-goals
SMTP or provider clients, networking, retries, persistence, templating, MIME encoding, and HTML rendering belong to adjacent packages.
MIT.
