Sharing Knowledge | System Admin Articles

Scripts : Shell script to send mail using telnet in Linux



while [ $count = 1 ]
do
( echo open MAIL-SERVER-NAME 25
sleep 8
echo helo MAIL-SERVER-NAME
echo mail from: SENDER-ADDRESS
sleep 2
echo rcpt to: RECIPIENT-ADDRESS
sleep 2
echo data
sleep 2
echo subject:  YOUR-SUBJECT-HERE
echo
echo
echo this is a test mail
sleep 5
echo .
sleep 5
echo quit ) | telnet
count=2
done


Labels: Linux, scripts

My Profile PhotoAbout the Author

I'm Parthiban, An UNIX System Admin by Profession. I'm Experienced in Linux/Unix System Administration and Scripting. I have done lot of work on the infrastructure Mgmt side in Linux, UNIX and Windows system administration, Hardware, Storage and Data center. I'm blogging since 2008.
Follow Me On Twitter or On Facebook

2 Comments for "Scripts : Shell script to send mail using telnet in Linux"

This script is really cool. I need more Script.

Thank you for your feedback dude.I Will post more scripts soon..

What do you think about this Article? Add your Opinion..!

Back To Top