Giter VIP home page Giter VIP logo

nodemailer's Introduction

node-nodemailer

React, Node.js, Express example app to send emails with module Nodemailer using Google standard account / a STMP service. It's configured with webpack, eslint, prettier and babel.

The Examples folder contains the final source code of "Send emails with Node.js module Nodemailer" gist.

Structure

All the source code will be inside src directory. Inside src, there is client and server directories. All the frontend code will be in client directory. Backend Node.js code will be in the server directory.

The React front end includes two simple component: App and Email Form. The call to Node.js backend is done in ../client/services/mailer.js.

The server back-end handles the POST request to send email in ../server/routes/mailer.js. The logic needed to send email with Nodemailer is contained in ../server/service/mailer/mailer.js

Configuration

To can send emails you need to rename config-sample.json to config.json.

{
  "guser": "Your google user",
  "refreshToken": "Google refresh token",
  "smtpServer": "SMTP host server",
  "smtpUser": "SMTP user",
  "smtpPass": "SMTP password"
}

To send emails with your Google account assign real values to guser and refreshToken. Then put downloaded credential JSON into ../server/service/mailer. Rename the JSON to credentials.json.

If you want to use a SMTP service leave blank guser and assign values to smtpServer, smtpUser and smtpPass.

Start

# Start development server 
npm run dev

# Build for production
npm run build

# Start production server
npm start

nodemailer's People

Contributors

riccardozambito avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.