Thursday, June 19, 2014

The most efficient way to send emails from Ubuntu shell script or cron

What is the most efficient way to send an email from Ubuntu shell script or cron? I have found sendEmail wins the battle:
sudo apt-get install sendemail
echo $CONTENT_BODY | \
sendEmail -f $FROM -t $TO1 $TO2 \
-s $MAIL_SERVER_HOSTNAME -u $SUBJECT > /dev/null 
Here is an example of its usage from cron BTW.

No comments:

Followers