JavaScript Contact Forms Node.js - Tutorial 2026
Node, React, React Native, Koa, Express, Fastify, Nodemailer SMTP를 사용하여 JavaScript 연락처 양식을 만들고 보내보세요.
작성자
Tiamati Email 팀
게시됨
3/1/26
읽을 시간
5분 이내
설치 및 요구사항
nodemailer npm 의존성을 설치해야 합니다:
npm install nodemailer
소스 코드 및 예제
이 예제는 Nodemailer 라이브러리와 공식 후원사 Forward Email 를 사용하여 발신 메일을 보내고 미리 봅니다.
발신 메일을 보내려면 비밀번호 생성이 필요합니다 – 저희 사용자 지정 도메인 SMTP로 이메일 보내기 가이드 를 따라주세요.
// app.js
import nodemailer from 'nodemailer';
const transporter = nodemailer.createTransport({
host: 'smtp.forwardemail.net',
port: 465,
secure: true,
auth: {
// TODO: replace `user` and `pass` values from:
// <https://forwardemail.net/guides/send-email-with-custom-domain-smtp>
user: 'you@example.com',
pass: '****************************'
},
});
await transporter.sendMail({
from: 'you@example.com',
to: 'user@gmail.com',
subject: 'hello world',
html: '<h1>hello world</h1>'
});
앱을 실행하여 이메일을 보내세요:
node app
이제 내 계정 → 이메일 에서 실시간 이메일 전송 상태, 이메일 전달 로그, HTML/텍스트/첨부파일 미리보기를 확인할 수 있습니다.
P.S. 🎉 또한 브라우저 및 iOS 시뮬레이터에서 이메일 미리보기 와 Node.js로 이메일 템플릿 만들기 가 가능합니다.