Index of every page on this site: llms.txt
All skills
Run it yourself

Adds email to any app with Forward Email (forwardemail.net) in one pass. It creates the domain, writes the MX, SPF, DKIM, DMARC and Return-Path DNS records, verifies them through the API, creates a sender alias and SMTP password, wires SMTP or the REST API into the code, and sends a test. Use it for any email task, including transactional or app email, contact forms, password resets, notifications, inbound mail, custom-domain mailboxes, aliases and forwarding, SMTP or IMAP settings, email DNS records, and mailers such as Nodemailer, ActionMailer or Django email. Use it even when no provider is named, unless the project already uses another one.

  • 3 files
  • 17.2 KB
  • Updated 2 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/forwardemail/skills/forward-email

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesapp-setup.md

≈1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Wiring Forward Email into an app

Keep credentials in the environment:

# .env (gitignored)
SMTP_HOST=smtp.forwardemail.net
SMTP_PORT=465
SMTP_USER=hello@example.com       # the alias
SMTP_PASS=...                     # from generate-password
MAIL_FROM="Example <hello@example.com>"
# only for the HTTP API:
FORWARD_EMAIL_API_KEY=...

SMTP ports: 465 or 2465 use implicit TLS (recommended). 587, 2587 or 2525 use STARTTLS.

Node.js (Nodemailer) — Express, Next.js route handlers, Remix, NestJS, and similar

import nodemailer from 'nodemailer';

const port = Number(process.env.SMTP_PORT || 465);

export const mailer = nodemailer.createTransport({
  host: process.env.SMTP_HOST,           // smtp.forwardemail.net
  port,
  secure: port === 465 || port === 2465, // implicit TLS; 587, 2587 and 2525 upgrade with STARTTLS
  auth: { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS }
});

await mailer.sendMail({ from: process.env.MAIL_FROM, to, subject, text, html });

In Next.js, run this only on the server (route handlers, server actions), never in client components.

HTTP API (any language, no SMTP library)

POST https://api.forwardemail.net/v1/emails takes a JSON body of Nodemailer message fields. Authenticate with the API key. from must be an alias on the verified domain.

const res = await fetch('https://api.forwardemail.net/v1/emails', {
  method: 'POST',
  headers: {
    // btoa works in Node 16+, Deno, Bun and edge runtimes
    Authorization: 'Basic ' + btoa(`${process.env.FORWARD_EMAIL_API_KEY}:`),
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ from: 'hello@example.com', to: 'user@example.org', subject: 'Welcome', html: '<p>Hi!</p>' })
});
if (!res.ok) throw new Error(`Forward Email ${res.status}: ${await res.text()}`);
curl -X POST https://api.forwardemail.net/v1/emails -u "$FORWARD_EMAIL_API_KEY:" \
  -H "Content-Type: application/json" \
  -d '{"from":"hello@example.com","to":"user@example.org","subject":"Hello","text":"It works"}'

The endpoint also accepts alias credentials in place of the API key (-u "hello@example.com:$SMTP_PASS"), but only when the alias has has_imap: true. The API key is simpler.

Python (smtplib)

import os, smtplib, ssl
from email.message import EmailMessage

msg = EmailMessage()
msg["From"], msg["To"], msg["Subject"] = os.environ["SMTP_USER"], "user@example.org", "Hello"
msg.set_content("It works")
with smtplib.SMTP_SSL("smtp.forwardemail.net", 465, context=ssl.create_default_context()) as s:
    s.login(os.environ["SMTP_USER"], os.environ["SMTP_PASS"])
    s.send_message(msg)

Django (settings.py)

import os

EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = "smtp.forwardemail.net"
EMAIL_PORT = 465
EMAIL_USE_SSL = True
EMAIL_HOST_USER = os.environ["SMTP_USER"]
EMAIL_HOST_PASSWORD = os.environ["SMTP_PASS"]
DEFAULT_FROM_EMAIL = os.environ.get("MAIL_FROM", EMAIL_HOST_USER)

Ruby on Rails (config/environments/production.rb)

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  address: "smtp.forwardemail.net",
  port: 465,
  user_name: ENV["SMTP_USER"],
  password: ENV["SMTP_PASS"],
  authentication: :plain,
  tls: true
}

Laravel (.env)

MAIL_MAILER=smtp
MAIL_HOST=smtp.forwardemail.net
MAIL_PORT=587          # STARTTLS is negotiated automatically
MAIL_USERNAME=hello@example.com
MAIL_PASSWORD=...
MAIL_FROM_ADDRESS=hello@example.com

Go (net/smtp, STARTTLS on 587)

auth := smtp.PlainAuth("", os.Getenv("SMTP_USER"), os.Getenv("SMTP_PASS"), "smtp.forwardemail.net")
msg := []byte("From: hello@example.com\r\nTo: user@example.org\r\nSubject: Hello\r\n\r\nIt works\r\n")
err := smtp.SendMail("smtp.forwardemail.net:587", auth, "hello@example.com", []string{"user@example.org"}, msg)

After wiring

Send one real message through the app's own code path to the user's address. Then confirm it with listEmails (GET /v1/emails) and check the daily limit with getEmailLimit.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 52c67ca. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 2 months ago

README badge

README badge for forwardemail/skills