Send Email
Send email via CLI tools or API using command line.
Process
- Check email configuration - Verify msmtp or sendmail is configured
- Prepare message - Format with proper headers (From, To, Subject)
- Choose delivery method - CLI tool or API endpoint
- Test with safe recipient - Verify configuration before real send
- Send email - Execute the delivery command
- 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
- Keep secrets in environment variables.
- Do not send emails without confirmation.