agentleFS
THEROCKSSSTHEROCKSSS/hermes-skills-portfolio/skills/email-send/SKILL.md

email-send

Skill1 starsChanged 3 months agoMITView on GitHub

Use when the user wants to send email programmatically from an app or script — transactional email, notifications, alerts, or reports — via SMTP or a provider API (Resend, SendGrid, Mailgun, AWS SES, Postmark).

  • Installs packages

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use that 16-character password in your SMTP config

    line 94

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

email-send

Overview

Set up programmatic email sending via SMTP or a transactional email API. The agent configures the provider, writes the sending code, and tests the connection. You get a working email function for your app, scripts, or agent tasks.

When to Use

  • The user wants to send email from their app or script.
  • The user wants to send notifications, alerts, or reports via email.
  • The user wants to set up a transactional email provider.
  • The user says "send email from my app", "set up email notifications", or "I need to email users".

Provider Comparison

ProviderFree tierSetupBest for
SMTP (Gmail, etc.)LimitedSMTP credsPersonal scripts, low volume
Resend3k/month freeAPI keyModern apps, developer-friendly
SendGrid100/day freeAPI keyEstablished apps, high volume
Mailgun5k/month (3mo)API keyEU hosting, routing
AWS SES62k free (from EC2)IAM credsAWS-native, cheapest at scale
Postmark100/month freeAPI keyHigh deliverability, transactional

Setup: SMTP

Simplest for low-volume personal use. Works with any email provider that supports SMTP.

Python (smtplib)

import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

def send_email(to: str, subject: str, body: str, html: bool = False):
    msg = MIMEMultipart()
    msg['From'] = 'you@example.com'
    msg['To'] = to
    msg['Subject'] = subject
    msg.attach(MIMEText(body, 'html' if html else 'plain'))

    with smtplib.SMTP('smtp.gmail.com', 587) as server:
        server.starttls()
        server.login('you@example.com', 'your-app-password')
        server.send_message(msg)
    return "Sent"

Node.js (nodemailer)

const nodemailer = require('nodemailer');

const transporter = nodemailer.createTransport({
    host: 'smtp.gmail.com',
    port: 587,
    secure: false,
    auth: {
        user: 'you@example.com',
        pass: 'your-app-password'
    }
});

async function sendEmail(to, subject, body) {
    await transporter.sendMail({
        from: 'you@example.com',
        to,
        subject,
        html: body
    });
    return 'Sent';
}

Gmail app password

For Gmail SMTP, you need an app-specific password (not your regular password):

  1. Enable 2FA on your Google account
  2. Go to https://myaccount.google.com/apppasswords
  3. Generate an app password for "Mail"
  4. Use that 16-character password in your SMTP config

Setup: Resend (API, recommended for apps)

pip install resend
# or
npm install resend
import resend
resend.api_key = "re_xxxxxxx"

params = {
    "from": "alerts@yourdomain.com",
    "to": ["user@example.com"],
    "subject": "Build complete",
    "html": "<p>Your build finished successfully.</p>"
}
email = resend.Emails.send(params)
const Resend = require('resend');
const resend = new Resend('re_xxxxxxx');

await resend.emails.send({
    from: 'alerts@yourdomain.com',
    to: 'user@example.com',
    subject: 'Build complete',
    html: '<p>Your build finished successfully.</p>'
});

Note: Resend requires verifying your sending domain (add DNS records). For testing without a domain, use onboarding@resend.dev as the from address.

Setup: AWS SES

import boto3

ses = boto3.client('ses', region_name='us-east-1',
    aws_access_key_id='YOUR_KEY',
    aws_secret_access_key='YOUR_SECRET'
)

ses.send_email(
    Source='alerts@yourdomain.com',
    Destination={'ToAddresses': ['user@example.com']},
    Message={
        'Subject': {'Data': 'Alert'},
        'Body': {'Html': {'Data': '<p>Server down</p>'}}
    }
)

Note: New SES accounts are in "sandbox" mode — you can only send to verified email addresses. Request production access to send to anyone.

Templating

Simple HTML template

def build_report_email(title: str, metrics: dict) -> str:
    rows = "".join(f"<tr><td>{k}</td><td>{v}</td></tr>" for k, v in metrics.items())
    return f"""
    <html><body>
    <h2>{title}</h2>
    <table border="1" cellpadding="8" style="border-collapse:collapse;">
    <tr><th>Metric</th><th>Value</th></tr>
    {rows}
    </table>
    <p style="color:#888;font-size:12px;margin-top:20px;">
    Sent by automated system. Do not reply.
    </p>
    </body></html>
    """

Jinja2 template

from jinja2 import Template

template = Template("""
<h2>{{ title }}</h2>
<ul>
{% for item in items %}
  <li>{{ item.name }}: {{ item.value }}</li>
{% endfor %}
</ul>
""")

html = template.render(title="Daily Report", items=data)

Attachments

import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders

msg = MIMEMultipart()
msg['Subject'] = 'Report with attachment'

with open('report.pdf', 'rb') as f:
    part = MIMEBase('application', 'octet-stream')
    part.set_payload(f.read())
    encoders.encode_base64(part)
    part.add_header('Content-Disposition', 'attachment; filename="report.pdf"')
    msg.attach(part)

with smtplib.SMTP('smtp.gmail.com', 587) as server:
    server.starttls()
    server.login('you@example.com', 'password')
    server.send_message(msg)

Common Pitfalls

  1. Gmail blocks less-secure apps — Use an app-specific password, not your regular password. Regular password auth is blocked by Google for most accounts.
  2. Emails going to spam — If using a custom domain, set up SPF, DKIM, and DMARC DNS records. Without these, recipient servers will likely mark your emails as spam. Transactional providers (Resend, SendGrid) handle this automatically.
  3. SES sandbox mode — New AWS SES accounts can only send to verified addresses. You must request production access to send to any address.
  4. Rate limits — Gmail SMTP limits ~500 emails/day. Resend's free tier is 3k/month. SendGrid is 100/day. For high volume, use a dedicated provider.
  5. HTML in plain text clients — Always include a plain-text alternative alongside HTML. Some email clients and all automated spam filters check for a text part.
  6. Attachment size — Most providers limit attachments to 10-25 MB. For larger files, upload to a storage service and send a download link.
  7. Sending domain not verified — Resend, SendGrid, and Mailgun require you to verify your sending domain (add DNS records). Without verification, emails will fail or be rejected.

Verification Checklist

  • Test send lands in the inbox (not spam) for both the plain-text and HTML parts
  • SPF/DKIM/DMARC records verified for a custom sending domain, or provider-managed domain (e.g. onboarding@resend.dev) confirmed for testing
  • Attachment (if any) downloads and opens correctly from the received message
  • Provider account confirmed out of sandbox mode (SES) or within the free-tier/rate limit for the expected send volume

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.