Send Email

Send email via CLI tools or API using command line.

Process

  1. Check email configuration - Verify msmtp or sendmail is configured
  2. Prepare message - Format with proper headers (From, To, Subject)
  3. Choose delivery method - CLI tool or API endpoint
  4. Test with safe recipient - Verify configuration before real send
  5. Send email - Execute the delivery command
  6. Confirm delivery - Check logs or API response for success

Examples

# msmtp (if configured)
cat << 'EOF' > /tmp/email.txt
From: you@example.com
To: them@example.com
Subject: Hello

This is a test email.
EOF

msmtp -t < /tmp/email.txt

sendmail fallback

sendmail -t < /tmp/email.txt

API fallback

Use curl to call a mail provider API if credentials are available.

Notes