@zugriff/mailman
v1.0.1
Published
E-Mails at the Edge
Downloads
4
Maintainers
Readme
@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: '[email protected]',
pass: 'password',
},
requireTLS: true,
}
);
Sending an email
await client.send(
new Mail({
to: new Contact({
name: 'Max Mustermann',
address: '[email protected]',
}),
from: new Contact('[email protected]'),
subject: 'Welcome',
message: new Message('Hi, Max! Thank you for signing up.'),
})
); // { anchor: "id", success: true }