I'm having trouble sending an email using bash and sendmail on Amazon Linux. In my bash script I have
echo "Subject: My subject" >> /tmp/email.txt
echo "" >> /tmp/email.txt
cat /tmp/out.txt >> /tmp/email.txt
sendmail $EMAIL_ON_FAILURE < /tmp/email.txt
Note that the body of my email should be the contents of /tmp/out.txt. Despite teh fact I have verified through echo that "$EMAIL_ON_FAILURE" is not empty, I'm not finding any emails in my inbox (or spam folders). Is there somethign wrong with the above or is there another way I can check on my system that the email was actually sent?