| name | description | metadata | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
email_sandbox |
Send email via HTTP API. Use when the agent should send email to a recipient. |
|
This skill lets the agent send email to recipients.
Use the Exec tool to run curl against the email API. The API is:
- Endpoint:
POST https://sandbox.api.mailtrap.io/api/send/{inbox_id} - Auth: header
Authorization: Bearer {MAILTRAP_API_TOKEN} - Body: JSON with
from,to,subject,text; optionalcategory,html, templates, etc. See Send email (including templates) | Mailtrap API for full parameters.
Important: The skill must be run through OpenClaw’s agent turn that injects skills.entries.email_sandbox.env, so MAILTRAP_API_TOKEN and MAILTRAP_INBOX_ID are set. Configure skills.entries.email_sandbox.env in ~/.openclaw/openclaw.json (see docs/openclaw-email-sandbox.example.json).
Request JSON shape:
from:{ "email": "sender@example.com", "name": "Sender Name" }(name optional)to:[{ "email": "recipient@example.com" }]subject: stringtext: string (plain body)category: optional string (e.g."Integration Test")- See Send email (including templates) for more fields (e.g.
html, templates, attachments).
Example curl:
curl --location --request POST "https://sandbox.api.mailtrap.io/api/send/${MAILTRAP_INBOX_ID}" \
--header "Authorization: Bearer ${MAILTRAP_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "User-Agent: OpenClaw" \
--data-raw '{"from":{"email":"hello@example.com","name":"Mailtrap Test"},"to":[{"email":"recipient@example.com"}],"subject":"You are awesome!","text":"Congrats for sending test email with Mailtrap!","category":"Integration Test"}'The agent should replace from, to, subject, and text with the actual values; category is optional. For bodies or subjects containing double quotes or newlines, build the JSON safely (e.g. with jq -n --arg from ... --arg to ... --arg subject ... --arg text ... '{from:{email:$from,name:"Agent"},to:[{email:$to}],subject:$subject,text:$text}' and pass it to curl -d @- or --data-raw @-).
On success the API returns HTTP 2xx and JSON like {"success":true,"message_ids":["..."]}. The message is delivered to the recipient.
Set skills.entries.email_sandbox.env in ~/.openclaw/openclaw.json to include MAILTRAP_API_TOKEN and MAILTRAP_INBOX_ID.
A future version may add reading the latest received message via the API (e.g. for OTP or forwarded messages). Currently only sending is supported.