@hkamran/utility-email
v1.0.0
Published
An easy way to send emails (powered by Nodemailer)
Downloads
2
Readme
@hkamran/utility-email
An easy way to send emails (powered by Nodemailer)
Installation
$ npm i @hkamran/utility-email
Usage
- Create a transport client with
createClient
function, passing the server name- Make sure the environment variables
SMTP_HOSTNAME
,SMTP_PORT
,SMTP_USERNAME
, andSMTP_PASSWORD
are set
- Make sure the environment variables
- Send an email with the
sendEmail
functiontransport
: The transport client created fromcreateClient
from
: The email you're sending fromto
: The email you're sending tosubject
: The email subjecthtml
: The HTML version of the emailplainText
: The plain-text version of the emailattachments
(optional): A list of attachments- Must follow Nodemailer's attachments syntax
listUnsubscribe
(optional): AList-Unsubscribe
header (more info)