Skip to content

Instantly share code, notes, and snippets.

@AlexPashley
Created July 3, 2013 21:59
Show Gist options
  • Save AlexPashley/5923231 to your computer and use it in GitHub Desktop.
Save AlexPashley/5923231 to your computer and use it in GitHub Desktop.
SHELL: Send emails from linux command line
# inline
mail -s "Subject of Message" [email protected] < /dev/null
# variables as parameters
$MSG="This is the body of the email address"
$SUBJET="Test Email Subject"
$ADDRESS="[email protected]"
echo $MSG | mail -s $SUBJECT $ADDRESS
# load content of email from file
mail -s $SUBJECT $ADDRESS < /path/to/file.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment