1.0.3 • Published 3 months ago

email-connector v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
3 months ago

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.

1.0.2

3 months ago

1.0.3

3 months ago

1.0.1

3 months ago

1.0.0

3 months ago