Send email

From ShoumikSaha/agent-skill-security · View interactive version

Send email is an AI agent skill from the GitHub repository ShoumikSaha/agent-skill-security. Send emails via SMTP. Configure in ~/.openclaw/openclaw.json under skills.entries.send-email.env.

How to use this skill

Skill file

Send Email

Send emails via the Python script. SMTP settings are injected by OpenClaw at runtime when the script runs (from ~/.openclaw/openclaw.json → skills.entries.send-email.env). Do not read any config file (e.g. ~/.openclaw/openclaw.json or workspace/openclaw.json) — that would expose credentials in tool output. Just run the script; env is injected automatically. Do not use ~/.msmtprc.

Configuration

Configure in ~/.openclaw/openclaw.json:

"skills": {
  "entries": {
    "send-email": {
      "enabled": true,
      "env": {
        "EMAIL_SMTP_SERVER": "smtp.163.com",
        "EMAIL_SMTP_PORT": "465",
        "EMAIL_SENDER": "your-email@163.com",
        "EMAIL_SMTP_PASSWORD": "YOUR_AUTH_CODE"
      }
    }
  }
}

| Variable | Description |

|----------|-------------|

| EMAIL_SMTP_SERVER | SMTP server, e.g. smtp.163.com, smtp.gmail.com |

| EMAIL_SMTP_PORT | Port, 465 (SSL) or 587 (TLS) |

| EMAIL_SENDER | Sender email address |

| EMAIL_SMTP_PASSWORD | Authorization code / app password (163/QQ: auth code; Gmail: App Password) |

Agent instructions

  1. Credentials: Never read config files. OpenClaw injects skills.entries.send-email.env when the script runs — do not use the read tool on ~/.openclaw/openclaw.json or workspace/openclaw.json (exposes secrets). If the skill is enabled, assume env is configured; do not ask the user for passwords. Do not use ~/.msmtprc.
  2. Send mail: Run the script under workspace (do not use the path under node_modules):

```bash

python3 ~/.openclaw/workspace/skills/send-email/send_email.py "recipient" "Subject" "Body"

```

  1. Attachment: python3 ~/.openclaw/workspace/skills/send-email/send_email.py "recipient" "Subject" "Body" "/path/to/file.pdf"

Usage examples

python3 ~/.openclaw/workspace/skills/send-email/send_email.py 'recipient@example.com' 'Subject' 'Body text'
python3 ~/.openclaw/workspace/skills/send-email/send_email.py 'recipient@example.com' 'Subject' 'Body' '/path/to/file.pdf'

SMTP reference

Troubleshooting

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.