send_email

Send an email using the system mail command.

The body is piped to stdin, equivalent to:

echo "body" | mail -s "subject" [email protected]

Usage

@send_email to="<address(es)>" subject="<subject>" [body="<text>"] [cc="<address(es)>"] [bcc="<address(es)>"]

Examples

Parameters

Parameter Type Description
to string Required. Recipient address(es), comma-separated
subject string Required. Email subject
body string Email body text, sent via stdin (default: empty)
cc string Cc address(es), comma-separated
bcc string Bcc address(es), comma-separated

Notes

  • Requires the mail command to be installed (mailutils / bsd-mailx / s-nail)
  • Requires a mail transfer agent (sendmail / postfix) to be configured for delivery
  • Not available on Windows
  • Addresses are validated: option-like values (e.g. -b) are rejected
  • Arguments are passed as a list, never through a shell