msmtp

An SMTP client. It reads text from stdin and sends it to an SMTP server. More information: https://marlam.de/msmtp.

echo "Hello world" | msmtp to@example.org

echo "Hello world" | msmtp --account=account_name to@example.org

echo "Hello world" | msmtp --host=localhost --port=999 --from=from@example.org to@example.org