email-connector

1.0.3 • Public • Published

email-connector

Connector for Gmail to send mails.

INSTALLATION

bash npm i email-connector

Usage

Importing the Library

const { createTransporter, sendEmail } = require('email-connector');

Configure your Nodemailer transporter

const transporterConfig = { service: 'gmail', auth: { user: 'me@gmail.com', pass: 'PASSWORD', }, };

replace user , pass with the actual gmail id and the password.

Email options

const mailOptions = { from: 'me@gmail.com', to: 'to@gmail.com', subject: 'test mail', attachments:[ { filename: 'filename' , path: '/path' } ], text: 'Hello, this is a test email!', };

replace from , to with the actual gmail id , attachments , text as per your requirement.

NOTE:

Before importing this library make sure to enable the "Less secure app access" If you cannot find the "Less secure app access" option in your account settings. use an "App Password " instead of your account password. App Passwords are generated specifically for apps or devices that don't support 2FA directly. You can generate App Passwords in your Google Account security settings.

Readme

Keywords

Package Sidebar

Install

npm i email-connector

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

2.58 kB

Total Files

3

Last publish

Collaborators

  • devimaigapu