Coder Social home page Coder Social logo

killshot13 / express-smtp-mailer Goto Github PK

View Code? Open in Web Editor NEW
40.0 0.0 17.0 1.1 MB

A production-ready Node backend with an Express SMTP mail server configurable for use with contact forms, subscriptions, etc.

License: MIT License

JavaScript 96.78% Shell 3.22%
express-js node-js nodemailer smtp-server smtp-mail production-ready gmail-smtp backend backend-services nodejs

express-smtp-mailer's Introduction

express-smtp-mailer


Status Usage Tooling Security Support
Build Status MIT license code style: prettier Known Vulnerabilities Maintained

ATTENTION: VERSION 2.0.0 HAS BEEN RELEASED. THIS IS A MAJOR SERMVER VERSIONING UPDATE AKA INCLUDES BREAKING CHANGES. PLEASE BE AWARE AND DON'T HESITATE TO REACH OUT IF YOU ARE EXPERIENCING NEGATIVE SIDE-EFFECTS FROM THE LATEST UPDATE.

Installation

git clone this repository

cd express-smtp-mailer to enter root directory

npm install to acquire the node_modules

code . to open VS Code (or your favorite editor)

Configuration

create a new .env file in the root directory

use the process.env variables defined in the .env.example and ./routes/mailrouter.js files to setup authentication

for development and testing, create an Ethereal account and enter the credentials of the testing account (if desired)

process.env.SMTP_DEV_EMAIL=''

process.env.SMTP_DEV_PASSWORD=''

for production, you need to create a project on Google Cloud Platform, create an internal project, authorize the Gmail API, and then establish a connection with your Google account. You can authenticate using OAuth 2.0 via the Google API Playground, and once you perform the initial authentication and accept the request permissions, Nodemailer will take over and automatically renew your login so it doesn't actually expire in production.

		clientId: process.env.CLIENT_ID,
		clientSecret: process.env.CLIENT_SECRET,
		refreshToken: process.env.REFRESH_TOKEN,
		accessToken: process.env.ACCESS_TOKEN,

Testing

go back to the terminal and run npm run dev

it should print out the following lines

Node dev server: listening on port 5000

Ready to send mail!

verify full functionality by replacing './frontend/frontend.js' with your own API routes and linking them to the endpoints defined in ./routes/mailrouter.js and ./server.js

Success

and there you have it!

a deployment-ready express smtp mail server

express-smtp-mailer's People

Contributors

dependabot[bot] avatar killshot13 avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

express-smtp-mailer's Issues

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.