[Error] nodemailer

Darcy Daeseok YU ·2022년 2월 26일
0

The issue is that nodemailer is a back-end server. It needs to run on a Node.js server. You can't use it to send emails from the browser.
Depending on your use-case, you'd typically build a Node.js server that works with your front-end to handle the mailing requirements of your application.

nodemailer는 backend에서 사용해야한다.

1.server를 만든다.
2.요청 url로 메일 발송 요청
3.nodemailer로 메일을 보낸다.

지금부터 mail서버를 구축해보자.

npm install express nodemailer dotenv cors body-parser

express lib : 웹과 모바일 어플리케이션 APIs 만들기 위한 강력한(robust) 기능을 제공
nodemailer : 쉽게 메일을 보내도록 해주는 모듈 for Node.js
dotenv: env 파일안에 선언한 환경 변수를 읽어 process.env로 전달.
body-parser: http body를 해석해주는 미들웨어
cors : Connect/Express 미들웨어를 제공하는 패키지.
Cross-Origin Resource Sharing :
https://surprisecomputer.tistory.com/32

profile
React, React-Native https://darcyu83.netlify.app/

0개의 댓글