본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)8.1k · #12615

webiny-mailer-smtp

하는 일

Webiny 프로젝트를 SMTP 이메일 서버에 연결해 이메일을 보낼 수 있게 하는 방법을 보여 줍니다. 이메일 발송을 설정하거나 도착하지 않는 이메일을 고치려는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Webiny 프로젝트에 SMTP 이메일 전송을 설정하고 싶을 때.
  • ✓Webiny 프로젝트에서 보낸 이메일이 나가지 않을 때.
  • ✓Webiny 이메일의 발신 주소나 회신 주소를 바꿔야 하는 경우.

스킬 링크

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/mailer-smtp/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/webiny/webiny-js/blob/next/skills/user-skills/mailer-smtp/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“Webiny 프로젝트가 이메일을 보낼 수 있도록 SMTP를 어떻게 설정하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 서버, 포트, 로그인, 발신자 정보가 담긴 코드 예제를 보여 줍니다. 비밀번호를 환경 변수에 두라고 강조하며, API를 바꾼 뒤에는 다시 배포하라고 알려 줍니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Mailer SMTP Configuration

TL;DR

Add <Api.Mailer.Smtp ... /> to your webiny.config.tsx to configure SMTP email delivery at build time. The component serializes the settings into the build artifact — always pass the password via an environment variable, never hard-code it. Deploy the API after making changes.

Core Pattern

import { Api } from "webiny/extensions";

<Api.Mailer.Smtp
    host={"smtp.example.com"}
    port={587}
    user={"smtp-user"}
    password={process.env.SMTP_PASSWORD!}
    from={"noreply@example.com"}
    replyTo={"support@example.com"}   {/* optional */}
/>

Place this inside the JSX returned by your config component in webiny.config.tsx, alongside other <Api.*> extensions.

Props Reference

Prop Type Required Description
host string Yes SMTP server hostname
port number Yes SMTP server port (positive integer)
user string Yes SMTP authentication username
password string Yes SMTP authentication password — use env var
from string Yes Default sender address
replyTo string No Default reply-to address

from and replyTo are validated by the email-addresses package against RFC 5322.

Full Example (webiny.config.tsx)

import React from "react";
import { Api, Admin, Core } from "webiny/extensions";

const MyConfig = () => {
  return (
    <>
      {/* ... other extensions ... */}

      {/* Mailer: configure SMTP transport via code */}
      <Api.Mailer.Smtp
        host={"smtp.sendgrid.net"}
        port={587}
        user={"apikey"}
        password={process.env.SENDGRID_API_KEY!}
        from={"noreply@acme.com"}
        replyTo={"support@acme.com"}
      />
    </>
  );
};

Add SENDGRID_API_KEY=your-secret to your .env file (never commit it).

Common Mistakes

Mistake Fix
Hard-coding the password Use process.env.SMTP_PASSWORD!
process.env.SMTP_PASSWORD undefined at build time → "expected string, received object" error Ensure the env var is set before deploying
from/replyTo value fails validation Must be a valid RFC 5322 mailbox address
Settings not taking effect Run yarn webiny build api after editing webiny.config.tsx

Quick Reference

# After editing webiny.config.tsx, build the API
yarn webiny build api

Note: This command only works in a dev environment. For other environments, run yarn webiny build api --env=YOUR_ENV instead.

// Environment variable in .env
SMTP_PASSWORD = your - smtp - password - here;

Related Skills

  • webiny-project-structure — Where webiny.config.tsx lives and how extensions are structured
  • webiny-local-development — Running and deploying locally
자주 묻는 질문

SMTP 설정은 어디에 넣나요?

webiny.config.tsx 파일에서 다른 API 설정을 반환하는 코드 안에 넣습니다.

비밀번호를 코드에 직접 쓰면 안 되는 이유는 무엇인가요?

설정은 빌드에 저장되므로 직접 쓴 비밀번호도 그곳에 저장된다고 스킬이 경고합니다. 환경 변수를 쓰면 비밀번호를 코드 밖에 둘 수 있습니다.

필수 설정은 무엇인가요?

호스트, 포트, 사용자, 비밀번호, 발신 주소는 필수이며, 회신 주소는 선택 사항입니다.

상세 정보

작성자의 원본 설명

Use when configuring SMTP email/mailer settings in a Webiny project. Triggers on: "configure email", "set up SMTP", "mailer config", "sending emails", "email not working", "configure mailer", "SMTP password", "Api.Mailer.Smtp".

repo: webiny/webiny-js

인기도

GitHub 스타
8.1k
순위
#12615
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬