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 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 from@domain.com to@domain.com | |
# curl -s https://gist.githubusercontent.com/amityweb/e0d1288a719e3ec2f028ec76b551cd86/raw/ | bash -s from@domain.com to@domain.com | |
# Loal File: | |
# bash send-test-email-from-to.sh from@domain.com to@domain.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment