Skip to content
Content
Skill

/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".

BOOST
From plugin
webiny-js
8k76 skills3 MCP
Install
$ npx -y skills add webiny/webiny-js --skill mailer-smtp --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/mailer-smtp

Context preview

The summary Claude sees to decide when to auto-load this skill.

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".

SKILL.md

mailer-smtp.SKILL.md
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

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`](https://www.npmjs.com/package/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
Read more
Ships withwebiny-js

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.

Get the whole plugin
Stats
8,049
Stars
682
Forks
Active
Maintenance
TypeScript
Language
15h ago
Last commit
8y ago
Created
2d ago
Added

Repo: webiny/webiny-js

Other skills on webiny-js.