Skip to content

The objective in this project is send an email through Gmail with NestJs Framework

Notifications You must be signed in to change notification settings

angel-js/SendEmailNestJS

Repository files navigation

Nest Logo

Description 📋

This project is made for send emails throug nest framework with nodemailer dependecie and use Ethereal mail to send the message (https://ethereal.email), for run this project basic and fast it is important that you enter in this page and create a new mail and click in the boton (Create Ethereal Account) then you copy the Nodemailer Configuration and modify the app module in the transport, disclaimer: the message is only read in this website

In another instance if you want to send message in Gmail you have to activate two factor auth and the password for divices it is necessary to add in app module that credentials

Dependencies 🔧

  1. Nodemailer
npm install nodemailer
  1. Nodemailer types
npm install --save @types/nodemailer
  1. Validator and Transformer to validate DTO
npm install --save class-validator class-transformer
  1. Environment variable
npm install --save dotenv
  1. Serve Static
npm install --save @nestjs/serve-static

Run Aplication ⚙️

Open CMD and search and open the project folder, run:

npm run start:dev

Try Path 🔩

In my case I use Postman but you can use any other aplication to try your Url Post

http://localhost:3000/email/send

Body, raw, JSON

{
    "toemail": "youremail@address.com",
    "sub": "Subject",
    "message": "Message"
}

About

The objective in this project is send an email through Gmail with NestJs Framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published