Welcome to the Email Validation API, a lightweight and efficient solution for sending validation emails to user-provided email addresses. This simple yet powerful Node.js application leverages the Express framework and Nodemailer library to facilitate seamless communication between your front-end and server, ensuring a smooth user experience.
npm install
.Update the .env
file with your Gmail credentials:
EMAIL_USER=your@gmail.com
EMAIL_PASS=your-password
PORT=3000
Start the server:
node app.js
Access the API via your front-end application by sending a POST request to /send-validation-email
with a JSON payload containing the email address.
Sends a validation email to the provided email address.
Request Body:
{
"email": "recipient@example.com"
}
Response (Success):
{
"message": "Email sent successfully"
}
Response (Error):
{
"error": "Failed to send email"
}
Contributions and suggestions are welcome! Feel free to fork this repository and submit pull requests to enhance the functionality or improve the documentation.
This project is licensed under the MIT License - see the LICENSE file for details.
With the Email Validation API, you can seamlessly integrate email validation into your applications, providing your users with a reliable and secure method to verify their email addresses. Enjoy the simplicity and power of this solution as you enhance your user experience and streamline your validation processes.