I want to send an email from a Linux Shell script. What is the standard command to do this and do I need to set up any special server names?
Another option for in a bash script:
mailbody="Testmail via bash script"
echo "From: info@myserver.test" > /tmp/mailtest
echo "To: john@mywebsite.test" >> /tmp/mailtest
echo "Subject: Mailtest subject" >> /tmp/mailtest
echo "" >> /tmp/mailtest
echo $mailbody >> /tmp/mailtest
cat /tmp/mailtest | /usr/sbin/sendmail -t
/tmp/mailtest is overwritten everytime this script is used.