emailjs.js

1.0.0 • Public • Published

Email

Email is a framework for send Email in Node.js applications.

Node.js (Install)

Requirements:

  • Node.js
  • npm (Node.js package manager)
npm install emailjs.js

Usage

Including all libraries, for access to extra methods:

var Email = require('emailjs');

var host = "smtp.gmail.com";
var port = 587;
var user = "user";
var pass = "password";

var email = new Email(host, port, user, pass);

var mailOptions = {
  from: 'youremail@gmail.com',
  to  : 'myfriend@yahoo.com',
  subject: 'Sending Email using Node.js',
  text: 'That was easy!'
  //html: '<h1>Welcome</h1><p>That was easy!</p>'
};

email.SendMail(mailOptions,
  function(error, data) {
      if (error) {
          console.log("An error occurred");
          console.log(data);
      }
      else {
          console.log("email IsConnected: " + email.IsConnected());
          console.log('Email sent: ' + data.response);
      }
  });

Readme

Keywords

Package Sidebar

Install

npm i emailjs.js

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

3.74 kB

Total Files

4

Last publish

Collaborators

  • michelerosica