Skip to content

Instantly share code, notes, and snippets.

@scizers
Forked from fbatschi/bash-smtp-auth-email
Created April 28, 2016 13:28
Show Gist options
  • Save scizers/25ab99c0fe578ac15b368b998e5c5e68 to your computer and use it in GitHub Desktop.
Save scizers/25ab99c0fe578ac15b368b998e5c5e68 to your computer and use it in GitHub Desktop.
How to send an email from bash via SMTP Auth
echo "PUT YOUR MAIL BODY HERE" | mailx -s "SUBJECT" -S smtp=smtp://yoursmtpserver.com -S smtp-auth=login -S smtp-auth-user=YOUR_USERNAME -S smtp-auth-password=YOUR_PASSWORD -S from="Sender Name <[email protected]>" [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment