Sendmail2 - Send Mail to Somewhere You Want
Sendmail2 is a package that you can create a transport of nodemailer(^6.6.1) or send emails directly.
You can install Sendmail2 using npm
, yarn
, or pnpm
.
# npm
npm i sendmail2
# yarn
yarn add sendmail2
# pnpm
pnpm add sendmail2
- Create a transport of nodemailer
import * as sendmail2 from 'sendmail2';
import nodemailer from 'nodemailer';
const transport = new sendmail2.Transport();
const transporter = nodemailer.createTransport(transport);
transporter.sendMail({
from: 'foo@example.com',
to: 'bar@example.com',
subject: 'Sendmail2',
text: 'Send mail 2 u!',
});
- Send an email directly
import * as sendmail2 from 'sendmail2';
const sender = new sendmail2.Sender();
sender.send({
from: 'foo@example.com',
to: 'bar@example.com',
subject: 'Sendmail2',
text: 'Send mail 2 u!',
});
The package is inspired by sendmail.
Contributing is welcome!
MIT