Send React Emails - Tutorial 2026
Send emails from React and Node.js web apps using HTML, CSS, and JSX templates. Production-ready SMTP integration guide with code examples and best practices.

์ค์น ๋ฐ ์๊ตฌ์ฌํญ
@react-email/render์ nodemailer npm ์์กด์ฑ์ ์ค์นํด์ผ ํฉ๋๋ค:
npm install @react-email/render nodemailer
์์ค ์ฝ๋ ๋ฐ ์์
.jsx ๋๋ .js ํ์ผ๋ก ์ด๋ฉ์ผ ํ
ํ๋ฆฟ์ ๋ง๋์ธ์:
// email.jsx
import * as React from 'react';
import { Html } from '@react-email/html';
import { Button } from '@react-email/button';
export function Email(props) {
const { url } = props;
return (
<Html lang="en">
<Button href={url}>์น์ฌ์ดํธ ๋ฐฉ๋ฌธํ๊ธฐ</Button>
</Html>
);
}
์ด ์์ ์์๋ Nodemailer ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๊ณต์ ํ์์ฌ์ธ Forward Email ์ ์ฌ์ฉํ์ฌ ๋ฐ์ ๋ฉ์ผ์ ๋ณด๋ด๊ณ ๋ฏธ๋ฆฌ๋ณด๊ธฐ ํฉ๋๋ค.
๋ฐ์ ๋ฉ์ผ์ ๋ณด๋ด๋ ค๋ฉด ๋น๋ฐ๋ฒํธ ์์ฑ์ด ํ์ํฉ๋๋ค โ ์ฌ์ฉ์ ๋๋ฉ์ธ SMTP๋ก ์ด๋ฉ์ผ ๋ณด๋ด๊ธฐ ๊ฐ์ด๋ ๋ฅผ ๋ฐ๋ผ์ฃผ์ธ์.
// app.js
import { render } from '@react-email/render';
import nodemailer from 'nodemailer';
import { Email } from './email';
const transporter = nodemailer.createTransport({
host: 'smtp.forwardemail.net',
port: 465,
secure: true,
auth: {
// TODO: ๋ค์์์ `user`์ `pass` ๊ฐ์ ๊ต์ฒดํ์ธ์:
// <https://forwardemail.net/guides/send-email-with-custom-domain-smtp>
user: 'you@example.com',
pass: '****************************'
},
});
const html = render(Email({ url: "https://example.com" }));
const options = {
from: 'you@example.com',
to: 'user@gmail.com',
subject: 'hello world',
html
};
transporter.sendMail(options);
์ฑ์ ์คํํ์ฌ ์ด๋ฉ์ผ์ ๋ณด๋ด์ธ์:
node app
์ด์ ๋ด ๊ณ์ โ ์ด๋ฉ์ผ ์์ ์ค์๊ฐ ์ด๋ฉ์ผ ์ ์ก ์ํ, ์ด๋ฉ์ผ ์ ๋ฌ ๋ก๊ทธ, HTML/ํ ์คํธ/์ฒจ๋ถํ์ผ ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ฅผ ํ์ธํ ์ ์์ต๋๋ค.
P.S. ๐ ๋ํ ๋ธ๋ผ์ฐ์ ๋ฐ iOS ์๋ฎฌ๋ ์ดํฐ์์ ์ด๋ฉ์ผ ๋ฏธ๋ฆฌ๋ณด๊ธฐ ์ Node.js๋ก ์ด๋ฉ์ผ ํ ํ๋ฆฟ ๋ง๋ค๊ธฐ ๋ ๊ฐ๋ฅํฉ๋๋ค.