Node Emailer
Node emailer allows you to send HTML based emails with or without attachments.
You can visit npm for more info on node-email-sender package
To use the package in your app
Run npm install node-email-sender
Import Package
Import this package where you want to use Email service.
var emailer = ;
Creating email configuration
Save this configuration in your existing configuration file or create a new one. Use this configuration in the file from which you want to send mail and simply pass the object in the mail function as a parameter.
emailConfig = emailFrom: 'EMAIL_FROM_ID' MANDATORY transporterConfig: service: 'SERVICE_PROVIDER' MANDATORY auth: user: 'EMAIL_ACCOUNT' MANDATORY pass: 'EMAIL_PASSWORD' MANDATORY port: 'EMAIL_POST' OPTIONAL | Default: 587 for unsecured and 465 for secured connection host: 'HOST_OR_IP_NAME' OPTIONAL | Default: localhost secure: 'EMAIL_SECURITY' OPTIONAL | Default: false tls: 'SECURE_SOCKET_CONSTRUCTOR' OPTIONAL | Default: false
Using the Node Emailer
Use this code snippet to call the emailer class function.
let response = emailer;
Sample code to run
var sendMail = ; let emailConfig = emailFrom: 'dummyemail@mailinator.com' transporterConfig: service: 'gmail' auth: user: 'dummyemail@mailinator.com' pass: 'sample-password' var response = sendMail; console;