a simple wrapper around nodemailer-smtp-transport for configuring and sending quick emails via smtp

Usage no npm install needed!

<script type="module">
  import simpleNodeMailerAndViewer from '';


Simple Node mailer

This package is a simple wrapper around the email-templates package this give a quick abstraction and help you send emails from your node js application with gmail to see more properties other than basic email sending please use the library above.


$ npm i --s simple-node-mailer ejs


Create a folder in the root of your application called emails create a sub-folder which takes the name of the email template you would love to send.

then create two files html.ejs which represents the body of the mail and subject.ejs which will be the subject of the mail.

As such you have this file structure when you are done.

 ┣ 📂forgot_password
 ┃ ┣ 📜html.ejs
 ┃ ┗ 📜subject.ejs
 ┗ 📂welcome_email
   ┣ 📜html.ejs
   ┗ 📜subject.ejs


For using your gmail account in sending mails follow this steps

- first turn on 2fa on your gmail account.
- Create a google mail app password.

const SimpleMailer = require('simple-node-mailer-viewer');

// if you want to use gmail
// set you email credentials in your environment variables.

const x = new SimpleMailer(
    // gmail credentials
    process.env.email_username + '',
    { service: 'gmail', host: '' },
    false // to enable preview 
    // if enabled the preview automatically opens a tab in browser

 * send to as many as your  customers as you wish
    to: [''],
    data: [{
        name: "john",
        address: "40 london Avenue, Canada"
    //the name of the template on your root folder
    template: 'welcome_email'
}, console.log)

in our new files


    Hello <%= name %>  this is a quick Notice for you 

    // html.ejs

    Mr / Mrs  <%= name %> your Rent at <%= address %> has expired and you will need to renew the sum of 50$ 
    click the link to pay now

    <button style="background:red: padding: 20px"> Click ME  <button>