#!/usr/bin/php "SUBJECT BODY -t RECIPIENT", "merge" => parent::ARGS, ["-F", "--from", "args" => 1, "name" => "from", "argsdesc" => "MAILFROM"], ["-t", "--to", "args" => 1, "action" => "--add", "name" => "to", "argsdesc" => "RECIPIENT"], ["-c", "--cc", "args" => 1, "action" => "--add", "name" => "cc", "argsdesc" => "RECIPIENT"], ["-b", "--bcc", "args" => 1, "action" => "--add", "name" => "bcc", "argsdesc" => "RECIPIENT"], ["args" => 2, "name" => "args"], ]; protected $to, $cc, $bcc, $from; function main() { $subject = $this->args[0] ?? null; ValueException::check_null($subject, "subject"); $body = $this->args[1] ?? null; ValueException::check_null($body, "body"); mailer::send($this->to, $subject, $body, $this->cc, $this->bcc, $this->from); } });