easy-emailer
v0.0.6
Published
A simple and convenient Node.js library for sending emails using Nodemailer.
Downloads
10
Maintainers
Readme
# easy-emailer
Easy Emailer is a simple and convenient Node.js library for sending emails using Nodemailer. It provides an easy-to-use interface to send emails with minimal configuration.
## Installation
Install the package using npm:
```bash
npm install easy-emailer
Usage
Setting up your environment variables
Before using Easy Mailer, make sure to set the following environment variables:
NODEMAIL_SERVICE
: The email service provider (e.g., "gmail", "yahoo").NODEMAIL_EMAIL
: Your email address.NODEMAIL_PASSWORD
: Your email account password (2FA generated password).
Example
const { sendAnyEmail } = require('easy-mailer');
const email = '[email protected]';
const subject = 'Test Email';
const htmlContent = '<p>Hello, this is a test email!</p>';
// Sending an email
await sendAnyEmail(email, subject, htmlContent);
API Reference
sendAnyEmail(email, subject, htmlContent)
email
(string): The recipient's email address.subject
(string): The subject of the email.htmlContent
(string): The HTML content of the email.
Sends an email using the configured email service.
Contributing
Contributions are welcome! Please follow the Contributing Guidelines for details.
Issues
If you encounter any issues or have questions, please open an issue.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Easy Mailer is built on top of the Nodemailer library.
- Special thanks to the open-source community for their contributions.
Author
Md Anisur Rahman, Nahid Hassan Bulbul
Feel free to customize this template further based on your project's specific features and requirements.