Saltar al contenido
Skillpedia
APIs y servidores (backend)8,1 mil · #12615

webiny-mailer-smtp

Qué hace

Muestra cómo conectar un proyecto Webiny a un servidor de correo SMTP para que pueda enviar correos. Es para desarrolladores que necesitan configurar el envío de correos o arreglar correos que no llegan.

Cuándo usarla

  • ✓Cuando un desarrollador quiere configurar el envío de correos SMTP en un proyecto Webiny.
  • ✓Cuando los correos de un proyecto Webiny no se envían.
  • ✓Cuando un desarrollador necesita cambiar la dirección del remitente o la de respuesta de los correos de Webiny.

Link de la skill

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

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/webiny/webiny-js/blob/next/skills/user-skills/mailer-smtp/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“¿Cómo configuro SMTP para que mi proyecto Webiny pueda enviar correos?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La habilidad ofrece un ejemplo de código con los datos del servidor, el puerto, el usuario y el remitente. Insiste en guardar la contraseña en una variable de entorno y recuerda desplegar la API después de los cambios.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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
Preguntas frecuentes

¿Dónde pongo los ajustes de SMTP?

En el archivo webiny.config.tsx, dentro del código que devuelve el resto de ajustes de la API.

¿Por qué no se debe escribir la contraseña en el código?

La habilidad advierte de que los ajustes se guardan en la compilación, así que una contraseña escrita quedaría almacenada allí. Una variable de entorno la mantiene fuera del código.

¿Qué ajustes son obligatorios?

El host, el puerto, el usuario, la contraseña y la dirección de remitente. La dirección de respuesta es opcional.

Detalles

Descripción original del autor

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

Popularidad

Estrellas en GitHub
8,1 mil
Posición en el ranking
#12615
Licencia
—
Actualizada
2/11/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas