Last active
March 4, 2024 13:10
-
-
Save amityweb/e0d1288a719e3ec2f028ec76b551cd86 to your computer and use it in GitHub Desktop.
Simple bash script to send a test email from and to someone
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
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 "To: Test <$to>\nFrom: Test <$from>\nSubject: $subject\n\n$body\n" | sendmail -f $from -t $to | |
# USAGE # | |
# NOTE: Some servers may need BASH not SH | |
# Directly from this URL: | |
# curl -s https://gist.githubusercontent.com/amityweb/e0d1288a719e3ec2f028ec76b551cd86/raw/ | sh -s [email protected] [email protected] | |
# curl -s https://gist.githubusercontent.com/amityweb/e0d1288a719e3ec2f028ec76b551cd86/raw/ | bash -s [email protected] [email protected] | |
# Loal File: | |
# bash 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