/mailer-smtp
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".
Claude Code
$ npx -y skills add webiny/webiny-js --skill mailer-smtp --agent claude-code
Codex
$ npx skills add webiny/webiny-js --skill mailer-smtp -a codex -y
Cursor
$ npx skills add webiny/webiny-js --skill mailer-smtp -a cursor -y
Gemini CLI
$ npx skills add webiny/webiny-js --skill mailer-smtp -a gemini-cli -y
GitHub Copilot
$ npx skills add webiny/webiny-js --skill mailer-smtp -a github-copilot -y
OpenCode
$ npx skills add webiny/webiny-js --skill mailer-smtp -a opencode -y
Windsurf
$ npx skills add webiny/webiny-js --skill mailer-smtp -a windsurf -y
SKILL.md
mailer-smtp.SKILL.mdname: webiny-mailer-smtp
description: >
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".
Mailer SMTP Configuration
TL;DR
New projects send mail over SMTP through `<Api.Mailer.Smtp />` from `webiny/extensions`, which `webiny.config.tsx` renders. It comes with the `webiny` package, so there is nothing to install. Without props, the settings are entered in the Admin app under Settings > Mailer. With props, they come from code and the settings screen shows them read-only. The props are serialized into the build artifact, so always pass the password through an environment variable, never hard-code it. Deploy the API after making changes.
To send through Resend, SendGrid or Amazon SES instead, replace `<Api.Mailer.Smtp />` with that provider's component (see `webiny-mailer-providers`).
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`, in place of the `<Api.Mailer.Smtp />` the project template added. Set all of `host`, `port`, `user`, `password` and `from`, or none of them.
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 |
\* Required when settings are set in code. Leave every prop out to enter the settings in the Admin app instead; `port`, `user`, `password` and `from` follow the same rule as `host`.
`from` and `replyTo` are validated by the [`email-addresses`](https://www.npmjs.com/package/email-addresses) package against RFC 5322.
Full Example (`webiny.config.tsx`)
import React from "react";
import { Api } from "webiny/extensions";
const MyConfig = () => {
return (
<>
{/* ... other extensions ... */}
{/* Mailer: SMTP settings set in 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-mailer-providers` — Sending through Resend, SendGrid or Amazon SES instead of SMTP
- `webiny-project-structure` — Where `webiny.config.tsx` lives and how extensions are structured
- `webiny-local-development` — Running and deploying locally
Read more
name: webiny-mailer-smtp description: > 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".
Mailer SMTP Configuration
TL;DR
New projects send mail over SMTP through `<Api.Mailer.Smtp />` from `webiny/extensions`, which `webiny.config.tsx` renders. It comes with the `webiny` package, so there is nothing to install. Without props, the settings are entered in the Admin app under Settings > Mailer. With props, they come from code and the settings screen shows them read-only. The props are serialized into the build artifact, so always pass the password through an environment variable, never hard-code it. Deploy the API after making changes.
To send through Resend, SendGrid or Amazon SES instead, replace `<Api.Mailer.Smtp />` with that provider's component (see `webiny-mailer-providers`).
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`, in place of the `<Api.Mailer.Smtp />` the project template added. Set all of `host`, `port`, `user`, `password` and `from`, or none of them.
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 |
\* Required when settings are set in code. Leave every prop out to enter the settings in the Admin app instead; `port`, `user`, `password` and `from` follow the same rule as `host`.
`from` and `replyTo` are validated by the [`email-addresses`](https://www.npmjs.com/package/email-addresses) package against RFC 5322.
Full Example (`webiny.config.tsx`)
import React from "react";
import { Api } from "webiny/extensions";
const MyConfig = () => {
return (
<>
{/* ... other extensions ... */}
{/* Mailer: SMTP settings set in 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-mailer-providers` — Sending through Resend, SendGrid or Amazon SES instead of SMTP
- `webiny-project-structure` — Where `webiny.config.tsx` lives and how extensions are structured
- `webiny-local-development` — Running and deploying locally
Open-source content platform. Self-hosted on AWS serverless. Built as a TypeScript framework you extend with code, not a closed product you configure through a UI. Runs on Lambda, DynamoDB, S3, and CloudFront inside your own AWS account. Scales automatically.
Other skills on webiny-js.
More skills from other plugins.
prompt-lookup
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use…
ppt-master
AI-driven presentation workflow for generating editable PPTX decks and slides, reconstructing page visuals, creating reusable…
morph-ppt
Use this skill when the user wants a .pptx with smooth cross-slide animation — PowerPoint Morph transitions, Keynote-style…
frontend-slides
Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to…
Questions about mailer-smtp.
- Which coding agents can use mailer-smtp?
- mailer-smtp installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

