Skip to content

Abhinav7972/node_mailer_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js Mailer API

A simple Node.js backend project that sends emails using Nodemailer based on data received through an HTTP POST request.

Features

  • Send emails dynamically using JSON payloads
  • Custom sender name
  • Custom recipient email
  • Custom message content
  • Environment variable support using dotenv
  • Event-driven email notification using EventEmitter

Installation

  1. Clone the repository
git clone <repository-url>
cd <project-folder>
  1. Install dependencies
npm install
  1. Create a pass.env file in the project root
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_google_app_password
  1. Generate a Google App Password
  • Open your Google Account
  • Go to Security
  • Enable 2-Step Verification
  • Open App Passwords
  • Generate an App Password
  • Copy the generated password into pass.env

Run the Server

node index.js

The server starts on:

http://localhost:5000

Example POST Request

Send a POST request using Postman or Thunder Client.

Request Body

{
  "from": "Abhinav",
  "to": "receiver@example.com",
  "message": "Hello from Node.js"
}

Example Response

data sent

Technologies Used

  • Node.js
  • Nodemailer
  • EventEmitter
  • dotenv
  • HTTP Module
  • File System (fs)

About

these is simple nodemailer project that send mail based on http post request body with node js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors