Simple Bash Script To Send Email Message

By | September 21, 2009

Here is a small script that used to send email from bash,

#!/bin/bash #Enter the email address to which we need to send the message EMAIL="**@talk2melbin.com" #Enter the subject of the email SUBJECT="Alert Service Down" #Enter the body of the message, read it from a file MESSAGE="/tmp/monitoring.tmp" #Mail command to send the email /bin/mail -s "$SUBJECT" "$EMAIL" < $MESSAGE

Cheers!
Melbin Mathew
www.talk2melbin.com

Melbin Mathew

I am Melbin Mathew, Systems Engineer from Kerala, India. I live with my parents, daughter and my wonderful wife. I graduated in 2004 with a bachelor’s degree in Electronics and Hardware from Mahatma Gandhi University, Kottayam and completed certification in MCITP, RHCE, CCNA, VCP ...Read More
Category: Scripts

About Melbin Mathew

I am Melbin Mathew, Systems Engineer from Kerala, India. I live with my parents, daughter and my wonderful wife. I graduated in 2004 with a bachelor’s degree in Electronics and Hardware from Mahatma Gandhi University, Kottayam and completed certification in MCITP, RHCE, CCNA, VCP ...Read More