chopinjs

1.0.5 • Public • Published

💙 Chopin JS

A simpler SMTP client for Node.js backend eviroment.

Getting Started

You can get the library by cloning it like follow bellow:

npm install chopinjs

After that, you can import the library on your node enviroment:

import Chopin from 'chopinjs';

Client

The client can be configured like bellow:

import Chopin from 'chopinjs'  

const config = {
  host: 'mail.gmail.com',
  port: 587,
  secure: false, // true for 465, false for other ports
  auth: {
    user: 'user@email.com',
    pass: 'foo@bar'
  }
};
const client = new Chopin(config);

Sending a email

To send a email, you can do like follow the example bellow:

const client = new Chopin();

const email = await client.send({
  from: 'contact@domain.com',
  to: 'example@email.com',
  subject: 'Hello',
  html: '<h1>Contact support</h1>'
});

Package Sidebar

Install

npm i chopinjs

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

90.9 kB

Total Files

8

Last publish

Collaborators

  • joaopjt