Last active
February 25, 2016 09:51
-
-
Save corenominal/90687417821164208dbc to your computer and use it in GitHub Desktop.
A really simple Shell script used for sending a test email
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOST=`cat /etc/hostname` | |
SUBJECT="Test Email from $HOST" | |
TO="[email protected]" | |
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