olee-send-email
v1.0.2
Published
A simple Node.js library for sending emails using Nodemailer.
Downloads
200
Readme
olee-send-email
A simple Node.js library for sending emails using Nodemailer.
Installation
To install the package, run the following command:
npm install olee-send-email
Configuration and Usage
To use the olee-send-email package in your project, follow these steps:
Import the sendEmail function into your project:
const { sendEmail } = require('olee-send-email');
Use the sendEmail function to send an email. Here is an example:
sendEmail({
to: '[email protected]',
subject: 'Test Email',
text: 'This is a test email.',
}).then(() => {
console.log('Email sent successfully!');
}).catch((error) => {
console.error('Error sending email:', error);
});
Environment Variables
Make sure to set the following environment variables in your .env file:
EMAIL_SERVICE=gmail
[email protected]
EMAIL_PASS=your-email-password
EMAIL_PORT=465
EMAIL_SECURE=true
EMAIL_CONNECTION_TIMEOUT=5000
EMAIL_MAX_CONNECTIONS=5