nodemailer-smtp
v1.1.0
Published
SMTP SDK for verification, templated email sending, and batched delivery using Nodemailer.
Downloads
129
Maintainers
Readme
nodemailer-smtp
nodemailer-smtp is a small SMTP SDK around Nodemailer for service-to-service mail sending, templated messages, and batch delivery.
Installation
npm install nodemailer-smtpFeatures
- transport verification
- default sender configuration
- templated subject, text, and HTML rendering
- batch send helper
- injectable transport factory for tests
Usage
const SmtpClient = require('nodemailer-smtp');
const client = new SmtpClient({
host: 'smtp.example.com',
port: 587,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASS,
},
defaults: {
from: '[email protected]',
},
});
await client.send({
to: '[email protected]',
subject: 'Build completed',
text: 'The deployment finished successfully.',
});API
new SmtpClient(options)verify()send(message)sendTemplate(template, data, message?)sendBatch(messages)renderTemplate(template, data)
License
MIT
