Sending email via command line
Requirements: sudo apt install mailutils sudo apt-get install ssmtp cat /etc/ssmtp/ssmtp.conf mailhub=email.firm.com:25 <smpt server> Then there are multiple ways to it cat temp To: harshal.patil@adyne.com Subject: Some Notifying Email MIME-Version: 1.0 Content-Type: text/plain Body of your email goes here. Hello world cat temp | sendmail -i -t OR echo -e "To: harshal.patil@firm.com\nSubject: Subject\nContent-type: text/html" | cat - /stage/qspc/projects/sas/tools/sas_slippage_outliers.html | sendmail -i -t OR 52 07 * * 1-5 echo "To: harshal.patil@firm.com, harshal.patil@firm.com \nSubject: Slippage Outliers $(date +\%F) \nContent-type: text/html\n\n" > /tmp/email_body.txt;cat /stage/qspc/projects/sas/tools/sas_slippage_outliers.html >> /tmp/email_body.txt;cat /tmp/email_body.txt | /usr/sbin/sendmail -i -t > /stage/qspc/logs/sendmail/$(date +\%d).log 2>&1 If wanted to attach as a file (when html contains graphs): (cat /...