Get the FREE Ultimate OpenClaw Setup Guide →

mailapp-send-email

npx machina-cli add skill IvanCampos/agents/mailapp-send-email --openclaw
Files (1)
SKILL.md
1.7 KB

Mail.app Send Email

Overview

Use the bundled AppleScript to compose and optionally send Mail.app messages with structured inputs (to/cc/bcc/subject/body/attachments).

Quick Start

Run the AppleScript via osascript with --to, --subject, and --body. Pass comma-separated lists for multiple recipients or attachments.

osascript /Users/ivancampos/.codex/skills/mailapp-send-email/scripts/send_mail.applescript \
  --to "test@test.com" \
  --subject "hello" \
  --body "testing"

Inputs

Use these flags. Only --to, --subject, and --body are required.

  • --to single email or comma-separated list
  • --cc optional comma-separated list
  • --bcc optional comma-separated list
  • --subject subject line
  • --body message body
  • --attach optional comma-separated POSIX file paths
  • --send optional true|false (default true, send immediately)

Behavior

  • Create a new outgoing message in Mail.app.
  • By default send immediately. If --send false, leave the draft visible for review.
  • If --attach is provided, add each file path as an attachment.

Troubleshooting

  • If Mail.app automation prompts appear, grant permissions in System Settings -> Privacy & Security -> Automation.
  • If attachments fail, ensure paths are absolute POSIX paths and the files exist.

Resources

scripts/

  • scripts/send_mail.applescript Create a Mail.app message with optional cc/bcc/attachments and optional immediate send.

Source

git clone https://github.com/IvanCampos/agents/blob/main/skills/mailapp-send-email/SKILL.mdView on GitHub

Overview

Mail.app Send Email uses a bundled AppleScript to compose and optionally send messages in Apple Mail. It supports to, cc, bcc, subject, body and optional attachments, enabling automation from scripts.

How This Skill Works

Run the AppleScript via osascript and pass flags like --to, --subject and --body. The script creates a new outgoing Mail.app message and can attach files if --attach is provided; by default it sends immediately unless --send is false.

When to Use It

  • Automating email sending from a macOS workflow or agent
  • Sending to multiple recipients using to cc or bcc
  • Including file attachments from POSIX paths
  • Creating drafts for review by setting --send false
  • Triggering Mail.app actions from scripts or OSAScript automation

Quick Start

  1. Step 1: Run the AppleScript via osascript with --to --subject and --body. Example: osascript /Users/ivancampos/.codex/skills/mailapp-send-email/scripts/send_mail.applescript --to "test@test.com" --subject "hello" --body "testing"
  2. Step 2: Pass comma separated lists for multiple recipients or attachments
  3. Step 3: Optionally include --attach and --send to control attachments and immediate sending

Best Practices

  • Use absolute POSIX paths for attachments
  • Test with --send false to review drafts
  • Grant Mail automation permissions in System Settings
  • Validate comma separated recipient lists for to cc and bcc
  • Keep subject and body content clear and avoid problematic characters

Example Use Cases

  • Send a welcome email to a new user with to and subject using osascript
  • Attach a contract PDF located at /Users/me/Documents/Contract.pdf to the message
  • Send to multiple recipients with CC and BCC in one go
  • Create a draft for internal review by setting --send false
  • Automatically send a daily status report as part of a macOS automation

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers