Skip to content

Instantly share code, notes, and snippets.

@mrpossoms
Created January 26, 2018 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrpossoms/1aaf779a33f1733833dbeac4432bcdef to your computer and use it in GitHub Desktop.
Save mrpossoms/1aaf779a33f1733833dbeac4432bcdef to your computer and use it in GitHub Desktop.
Script for sending email alerts from a unix cli
#!/bin/bash
msg_file=/tmp/$(hexdump -n 16 -e '4/4 "%08X" 1 "\n"' /dev/random).mail
echo "subject:ping" > $msg_file
echo $1 >> $msg_file
sendmail $1 YOUR-EMAIL@DOMAIN.com < $msg_file
rm $msg_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment