chopinjs
v1.0.5
Published
A simpler SMTP client for Node.js backend eviroment.
Downloads
1
Maintainers
Readme
:blue_heart: 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: '[email protected]',
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: '[email protected]',
to: '[email protected]',
subject: 'Hello',
html: '<h1>Contact support</h1>'
});