email-send
Skill2 starsChanged 35 days agoMITView on GitHub
Let an app-foundation site send email from the owner's own domain (Resend, free tier 3,000/month), with DNS checks so mail doesn't land in spam and a /email-test page. Use when the user says "let my site send email", "send email from my domain", "set up Resend", or a later skill (auth-login, pay-receipts) requires email-send.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- THEROCKSSS/hermes-skills-portfoliotheir own version, first seen Aug 3, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- THEROCKSSS/hermes-skills-portfolio★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/app-foundation/template/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/app-foundation/template/CLAUDE.mdCLAUDE.md
- app-foundationSkill
- auth-loginSkill
- db-backupSkill
- db-connectSkill
- deploy-cloudflareSkill
- domain-setupSkill
- env-secretsSkill
- file-uploadSkill
- github-vercel-deploySkill
- launch-kitSkill
- ops-dashboardSkill
- pay-checkoutSkill
- pay-subscriptionSkill
- pay-webhookSkill
- uptime-alertSkill
- warehouse-siteSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Use a subdomain: Resend recommends it, and it keeps the root domain's own mailbox and reputation untouched.
- Distinctive: line 69
Don't touch existing MX/TXT records for the root domain.
- Distinctive: line 84
When it passes, click Verify in Resend (often verified within 15 minutes.
- Very specific: line 114
Every send records email.sent or email.failed in core_events with a masked address (zh*@gmail.com), so other systems can react without …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
email-send
Goal: the site can email anyone (login codes, receipts, notifications) from the owner's own domain, and the mail reaches the inbox. Follow ../../STACK.md.
The owner may not be a programmer:
- Signing up at Resend, accepting terms, and creating the API key are the owner's clicks.
- The API key goes straight from Resend into Vercel. Never ask them to paste it into the chat, and never type it yourself.
- Adding DNS records needs their OK, same as domain-setup.
Why Resend, and why your own domain
- Free: 3,000 emails/month, max 100/day, 3 domains (checked 2026-10-14 at resend.com/pricing; check again before quoting). Paid starts at $20/month.
- Without a verified domain, Resend only lets you send to your own address. So a real domain (episode 004) is required before strangers can get a login code.
- The code calls Resend's plain HTTP API (no SDK), so it runs on Vercel and Cloudflare. Changing provider means rewriting only
src/lib/email.ts.
Steps
1. Choose the sending address
Use a subdomain: Resend recommends it, and it keeps the root domain's own mailbox and reputation untouched.
| Site | Sending domain | From |
shop.example.com or example.com | mail.example.com | My Shop <hello@mail.example.com> |
2. Prepare the code
node <skill-dir>/scripts/apply.mjs --dir "<project>" --sending-domain mail.example.com --jsonSafe to run twice. Adds src/lib/email.ts (sendEmail()), the /email-test page, an .env.example block, stack.json → installed and email, and a git save point. Push it.
3. Resend account and domain (owner clicks; you guide)
- resend.com → sign up. "Log in with Google" is the simplest. The owner accepts the terms.
- Domains → Add domain → the sending domain from step 1. Pick the region nearest the users (default is fine).
- Resend shows the records. In October 2026 a new domain got these (older accounts may see MX + SPF TXT on
sendinstead):
| Type | Host (Namecheap/GoDaddy style, root domain left off) | Value |
| TXT | resend._domainkey.mail | the long DKIM key (p=MIGf...), nothing else |
| CNAME | send.mail | send.forge.rmta.net |
| CNAME | rsend.mail | rsend.forge.rmta.net |
| TXT (recommended) | _dmarc.mail | v=DMARC1; p=none; |
Copy the values from Resend's page, not from this table. Two changes from what Resend shows:
- Resend lists DMARC with Host
_dmarc, which sets a policy for the whole root domain. Use_dmarc.<sub>(e.g._dmarc.mail), which covers only the sending subdomain. - Skip the Enable Receiving MX record unless the site must receive mail. That record is the one that could clash with an existing mailbox.
The page also offers "Go to <provider>". Some providers can add the records automatically. Treat that as the owner's choice and the owner's click.
4. Add the records at the DNS provider (owner's OK)
- Namecheap / GoDaddy / Aliyun: the Host field already ends in the domain. Type only
resend._domainkey.mail, not the full name, or it becomes...labpencil.com.labpencil.com. The check script detects this mistake (doubled-host). - Copy one value at a time. In testing, the DKIM value got the next rows of the table pasted along with it. Resend stays Pending, and resolvers cache the wrong value for up to 30 min after it's fixed. The check script reports this as
dkim-garbled. When you tell the owner what to paste, put each value in its own code block, not only in a table; copying from a table row is how it happened. - Cloudflare: grey cloud (DNS only) for everything. Proxied records break verification.
- Don't touch existing MX/TXT records for the root domain. Those are their current mailbox.
Then check (read-only):
node <skill-dir>/scripts/check.mjs --domain mail.example.com --wait 900| Code | Meaning |
dkim / spf / rsend / mx | That record isn't visible yet, or the value is wrong |
dkim-garbled | Extra text was pasted after the DKIM key; make the Value only p=... |
doubled-host | The full domain was typed into Host; keep only the part before it |
dmarc (○, recommended) | No DMARC yet. Add v=DMARC1; p=none; on _dmarc.<sending domain> |
When it passes, click Verify in Resend (often verified within 15 minutes; DNS can take up to 72 h).
5. API key and variables (owner pastes the key)
- Resend → API Keys → Create API key, permission Sending access, domain = the sending domain.
- The owner copies it into Vercel → project → Settings → Environment Variables:
| Name | Value | Secret? |
RESEND_API_KEY | re_... | yes: owner only, mark Sensitive |
EMAIL_FROM | My Shop <hello@mail.example.com> | no |
EMAIL_TEST_TO | optional: the owner's inbox, used when the recipient field is left empty (and the only address allowed without the code). Leave it out to keep the owner's address off the public page | no |
EMAIL_TEST_CODE | optional test passphrase, needed to send to other addresses from /email-test | yes: owner only |
You may add the two non-secret ones yourself with the owner's OK.
- Redeploy so the variables take effect.
6. Test
Open https://<domain>/email-test, type any address (or leave it empty to use EMAIL_TEST_TO) → Send a test email. The page is public, so sending to an address other than EMAIL_TEST_TO requires EMAIL_TEST_CODE; without that variable it can only email the owner. It always allows at most one email a minute and 10 a day, with fixed content, so strangers can't use the domain to send spam. Never put the address in the URL. After auth-login (episode 006), consider limiting this page to admins. Ask the owner whether the email arrived in the inbox, not spam. In Gmail → ⋮ → Show original, SPF, DKIM and DMARC should all show PASS.
Using it in code
import { sendEmail } from "@/lib/email";
const r = await sendEmail({ to, subject: "Your sign-in code", text: `Your code is ${code}`, tag: "login-code" });
if (!r.ok) /* show a friendly error; r.error has details */;Every send records email.sent or email.failed in core_events with a masked address (zh***@gmail.com), so other systems can react without exposing addresses.
Tell the user (short)
"Your site can now send email from hello@<sending domain>, free up to 3,000 emails a month and 100 a day." Add one line: next is auth-login (episode 006), which uses this to send login codes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

