@storecraft/mailer-smtp
v1.0.4
Published
Official SMTP email provider for node, deno and bun for storecraft
Downloads
251
Maintainers
Readme
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, // true for 465, false for other ports
auth: {
user: 'apikey', // generated ethereal user
pass: process.env.SEND_GRID_SECRET, // generated ethereal password
},
}
);
let { success, native_response } = await mailer.email({
from: {name: 'bob 👻', address: process.env.FROM_EMAIL }, // sender address
to: [ { address: process.env.TO_EMAIL } ], // list of receivers
subject: 'subject test', // Subject line
text: 'plain text test', // plain text body
html: '<p>html test</p>', // html body
});
Author: Tomer Shalev ([email protected])