@zugriff/mailman
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@zugriff/mailman

This package is part of the zugriff ecosystem. It runs on both Edge Runtimes using the fetch API and your machine using the fetch API or the nodemailer package.

Usage

npm i --save @zugriff/mailman

Creating a client

import { Mailman, Mail, Contact, Message } from '@zugriff/mailman';

// SMTP Client
const client = new Mailman(
  process.env.ZUGRIFF_MAILMAN_TOKEN || {
    host: 'localhost',
    port: 465,
    auth: {
      user: 'hello.world@zugriff.eu',
      pass: 'password',
    },
    requireTLS: true,
  }
);

Sending an email

await client.send(
  new Mail({
    to: new Contact({
      name: 'Max Mustermann',
      address: 'max.mustermann@example.com',
    }),
    from: new Contact('erika.mustermann@example.com'),
    subject: 'Welcome',
    message: new Message('Hi, Max! Thank you for signing up.'),
  })
); // { anchor: "id", success: true }

Package Sidebar

Install

npm i @zugriff/mailman

Weekly Downloads

5

Version

1.0.2

License

MIT

Unpacked Size

25.8 kB

Total Files

8

Last publish

Collaborators

  • lucagoslar