#!/usr/bin/osascript on run argv if (count of argv) < 2 then return "Usage: send_email.scpt " end if set recipientAddress to item 1 of argv set msgSubject to item 2 of argv set msgContent to item 3 of argv tell application "Mail" set newMessage to make new outgoing message with properties {subject:msgSubject, content:msgContent, visible:false} tell newMessage make new to recipient at end of to recipients with properties {address:recipientAddress} end tell send newMessage end tell return "Email sent to " & recipientAddress end run