SMTP proxy client for Node.js
Features
- Send emails using a known smtp server
- uses
nodemailer
under the hood
npm i @storecraft/mailer-smtp
Howto
import { MailerSmtpNode } from '@storecraft/mailer-smtp';
const mailer = new MailerSmtpNode(
{
host: "smtp.sendgrid.net",
port: 465,
secure: true,
auth: {
user: 'apikey',
pass: process.env.SEND_GRID_SECRET,
},
}
);
let { success, native_response } = await mailer.email({
from: {name: 'bob 👻', address: process.env.FROM_EMAIL },
to: [ { address: process.env.TO_EMAIL } ],
subject: 'subject test',
text: 'plain text test',
html: '<p>html test</p>',
});
Author: Tomer Shalev (tomer.shalev@gmail.com)