webiny-mailer-smtp
What it does
Shows how to connect a Webiny project to an SMTP email server so it can send emails. It is for developers who need to set up email sending or fix emails that do not arrive.
When to use it
- ✓When a developer wants to set up SMTP email delivery in a Webiny project.
- ✓When a developer's emails are not being sent from a Webiny project.
- ✓When a developer needs to change the sender address or reply-to address for Webiny emails.
Skill link
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/mailer-smtp/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“How do I set up SMTP so my Webiny project can send emails?”
5 new skills a week. 1 minute to read.
How it works
The skill gives a code example with the server, port, login and sender details. It stresses storing the password in an environment variable and reminds you to deploy the API after changes.
Technical content (original SKILL.md)
Original text by the author, straight from 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
devenvironment. For other environments, runyarn webiny build api --env=YOUR_ENVinstead.
// Environment variable in .env
SMTP_PASSWORD = your - smtp - password - here;
Related Skills
webiny-project-structure— Wherewebiny.config.tsxlives and how extensions are structuredwebiny-local-development— Running and deploying locally
FAQ
Where do I put the SMTP settings?
In the webiny.config.tsx file, inside the code that returns the other API settings.
Why should the password not be typed into the code?
The skill warns that settings are saved into the build, so a typed password would be stored there. An environment variable keeps it out of the code.
Which settings are required?
The host, port, user, password and from address are required. The reply-to address is optional.
Details
Original description by the author
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
Popularity
- GitHub stars
- 8.1k
- Ranking position
- #12615
- License
- —
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
prd-to-plan
8.1kHelps your agent turn a product requirements document into a phased plan of small end-to-end slices, saved as a Markdown file.
webiny-admin-architect
8.1kTeaches your agent how to build admin screens for the Webiny platform, using its business logic layers and presenter pattern.
webiny-admin-permissions
8.1kTeaches your agent to add permission controls to Webiny admin screens, including auto-generated permission forms and hide-or-show checks.
webiny-form-model
8.1kTeaches your agent to build forms in Webiny using a declarative field builder, layouts, validation and conditional rules.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.