Skip to content

Instantly share code, notes, and snippets.

@amityweb
Last active March 4, 2024 13:10
Show Gist options
  • Save amityweb/e0d1288a719e3ec2f028ec76b551cd86 to your computer and use it in GitHub Desktop.
Save amityweb/e0d1288a719e3ec2f028ec76b551cd86 to your computer and use it in GitHub Desktop.
Simple bash script to send a test email from and to someone
subject="Email Test"
body="Hello World. This is an email test and I am including this paragraph of content to gain extra points if there is a substantial body message included. Thank you."
from="$1"
to="$2"
echo -e "Subject:${subject}\n${body}" | sendmail -f "<${from}>" -t "${to}"
# USAGE #
# Directly from this URL:
# curl -s https://gist.github.com/amityweb/e0d1288a719e3ec2f028ec76b551cd86/raw/ | sh -s [email protected] [email protected]
# Loal File:
# sh send-test-email-from-to.sh [email protected] [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment