Skip to content

Instantly share code, notes, and snippets.

@fbatschi
Created March 17, 2015 21:18
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save fbatschi/2409e57cf4f8d7298860 to your computer and use it in GitHub Desktop.
Save fbatschi/2409e57cf4f8d7298860 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 <sender@mail.com>" recipient@mail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment