email-otp-send
v1.5.0
Published
Quickly and securely send OTPs for user verification within your Node.js applications.
Downloads
10
Readme
Effortless and Secure OTP Emailing
Quickly and securely send OTPs for user verification within your Node.js applications.
Overview
email-otp-send is a powerful Node.js module that streamlines the process of sending secure, customizable OTP emails for user verification. It leverages the popular Nodemailer library and provides flexible parameters, intuitive error handling, and clear UI guidance, making integration effortless.
Features
Robust Security:
- Generates random, unpredictable OTPs using a customizable character set of numbers
- Offers optional OTP length control for enhanced flexibility.
- Adheres to industry best practices for secure emailing.
Seamless Integration:
- Works seamlessly with Nodemailer, providing access to a wide range of SMTP server options.
- Simple and intuitive API for easy integration into your applications.
Flexibility and Customization:
- Control OTP length, email subject and HTML for tailored experiences.
- Handle optional parameters for advanced email configuration.
Exceptional Error Handling:
Catches and reports errors elegantly, providing meaningful messages for debugging.
Makes handling potential issues in your application easier.
Prerequisites
- Node.js and npm (or yarn) installed on your system.
- An SMTP server account with your preferred email provider.
Installation
npm i email-otp-send
Usage
//import package
const sendOtp =require('email-otp-send');
host ="host name of email provider"
port ="port number"
user ="username of SMTP "
pass ="password"
email ="email address to send otp"
//otional parameter
otpLength : length of OTP //default 6 if not passed
subject : subject of Email// default "Email Verification"
//gives otp sent to email
const otp = await sendOtp(host, port, user, pass, email, options = {otpLength:7})
Contributing:
We welcome contributions to the email-otp-send package!
License:
This package is licensed under the MIT License.
I hope this expanded information is helpful! Feel free to ask any further questions you may have.