Skip to content

Instantly share code, notes, and snippets.

@corenominal
Last active February 25, 2016 09:51
Show Gist options
  • Save corenominal/90687417821164208dbc to your computer and use it in GitHub Desktop.
Save corenominal/90687417821164208dbc to your computer and use it in GitHub Desktop.
A really simple Shell script used for sending a test email
#!/bin/bash
HOST=`cat /etc/hostname`
SUBJECT="Test Email from $HOST"
TO="email@example.com"
MSG="/tmp/mail-test.msg"
echo "This is a test email message from $HOST." > $MSG
echo "Please do not respond to this message." >> $MSG
mail -s "$SUBJECT" "$TO" < $MSG
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment