nylas email send \ --to [email protected] \ --subject "Build #4129 failed" \ --body "See https://ci.example.com/4129 for details."
nylas email send \ --to [email protected] \ --subject "Build #4129 failed" \ --body "See https://ci.example.com/4129 for details."
nylas email send \ --to [email protected] \ --subject "Build #4129 failed" \ --body "See https://ci.example.com/4129 for details."
# In .github/workflows/notify.yml
- run: | nylas email send \ --to [email protected] \ --subject "🚨 main is red" \ --body "Run: ${{ github.run_id }}\nCommit: ${{ github.sha }}"
# In .github/workflows/notify.yml
- run: | nylas email send \ --to [email protected] \ --subject "🚨 main is red" \ --body "Run: ${{ github.run_id }}\nCommit: ${{ github.sha }}"
# In .github/workflows/notify.yml
- run: | nylas email send \ --to [email protected] \ --subject "🚨 main is red" \ --body "Run: ${{ github.run_id }}\nCommit: ${{ github.sha }}"
# /etc/cron.daily/db-backup
#!/usr/bin/env bash
if pg_dump --quiet ourdb | gzip > /backups/$(date +%F).sql.gz; then nylas email send --to [email protected] \ --subject "DB backup OK" \ --body "$(date): backup complete. Size: $(du -h /backups/$(date +%F).sql.gz)"
else nylas email send --to [email protected] \ --subject "🔴 DB backup FAILED" \ --body "Check /var/log/db-backup.log on $(hostname)"
fi
# /etc/cron.daily/db-backup
#!/usr/bin/env bash
if pg_dump --quiet ourdb | gzip > /backups/$(date +%F).sql.gz; then nylas email send --to [email protected] \ --subject "DB backup OK" \ --body "$(date): backup complete. Size: $(du -h /backups/$(date +%F).sql.gz)"
else nylas email send --to [email protected] \ --subject "🔴 DB backup FAILED" \ --body "Check /var/log/db-backup.log on $(hostname)"
fi
# /etc/cron.daily/db-backup
#!/usr/bin/env bash
if pg_dump --quiet ourdb | gzip > /backups/$(date +%F).sql.gz; then nylas email send --to [email protected] \ --subject "DB backup OK" \ --body "$(date): backup complete. Size: $(du -h /backups/$(date +%F).sql.gz)"
else nylas email send --to [email protected] \ --subject "🔴 DB backup FAILED" \ --body "Check /var/log/db-backup.log on $(hostname)"
fi
import subprocess
try: process_payments()
except CriticalError as e: subprocess.run([ 'nylas', 'email', 'send', '--to', '[email protected]', '--subject', f'Payment processor down: {e.code}', '--body', str(e) ], check=True)
import subprocess
try: process_payments()
except CriticalError as e: subprocess.run([ 'nylas', 'email', 'send', '--to', '[email protected]', '--subject', f'Payment processor down: {e.code}', '--body', str(e) ], check=True)
import subprocess
try: process_payments()
except CriticalError as e: subprocess.run([ 'nylas', 'email', 'send', '--to', '[email protected]', '--subject', f'Payment processor down: {e.code}', '--body', str(e) ], check=True)
# 1. Install
brew install nylas/nylas-cli/nylas
# or: curl -fsSL https://cli.nylas.com/install.sh | bash # 2. Auth (paste your API key)
nylas auth config --api-key YOUR_KEY # 3. Send a test
nylas email send --to [email protected] --subject "test" --body "hi from the new world" # 4. Replace every "sendmail -t" call with "nylas email send"
grep -r 'sendmail\|mailx' /etc /home /opt /var/scripts | wc -l
# That number is your migration scope. # 5. systemctl disable postfix && systemctl stop postfix
# 1. Install
brew install nylas/nylas-cli/nylas
# or: curl -fsSL https://cli.nylas.com/install.sh | bash # 2. Auth (paste your API key)
nylas auth config --api-key YOUR_KEY # 3. Send a test
nylas email send --to [email protected] --subject "test" --body "hi from the new world" # 4. Replace every "sendmail -t" call with "nylas email send"
grep -r 'sendmail\|mailx' /etc /home /opt /var/scripts | wc -l
# That number is your migration scope. # 5. systemctl disable postfix && systemctl stop postfix
# 1. Install
brew install nylas/nylas-cli/nylas
# or: curl -fsSL https://cli.nylas.com/install.sh | bash # 2. Auth (paste your API key)
nylas auth config --api-key YOUR_KEY # 3. Send a test
nylas email send --to [email protected] --subject "test" --body "hi from the new world" # 4. Replace every "sendmail -t" call with "nylas email send"
grep -r 'sendmail\|mailx' /etc /home /opt /var/scripts | wc -l
# That number is your migration scope. # 5. systemctl disable postfix && systemctl stop postfix - Accepts mail from sendmail -t or mail
- Hands it to a smart relay (SES, SendGrid, Mailgun, or your provider of choice)
- Logs the result - Inbound mail to a custom domain — though even this is now better solved with a managed agent account: nylas agent account create [email protected], then poll with nylas email list or webhook with nylas webhook create --triggers message.created.
- Air-gapped networks with no outbound HTTPS — Postfix to a DMZ relay still wins.
- Compliance regimes that forbid third-party mail relays — a niche, but real. - Send email from the terminal — full reference for outbound CLI mail
- Best CLI email tools compared — mutt, mailx, msmtp head-to-head
- Receive email without an SMTP server — the inbound counterpart
- Full command reference