I'm trying to send an email from a bash script but when I run the script it completes without any errors but the email doesn't seem to be sending (it doesn't arrive in my inbox at least)
SUBJECT="SET-EMAIL-SUBJECT"
EMAIL="[email protected]"
EMAILMESSAGE="/home/me/workspace/ss/UI/UI/legacy/Output.txt"
echo "This is an email message test">$EMAILMESSAGE
echo "This is a second line">>$EMAILMESSAGE
echo "This is a third line">>$EMAILMESSAGE
# send an email using /bin/mail
`/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE`
Thanks
mailcommand manually works? Are you positively running a MTA, such as exim4, postfix or sendmail - and is it correctly configured?rootor your username. Then run themailcommand as this user. This will allow you to check if local delivery works even if sending mail to the internet is not setup correctly. I've not tested it but your script looks okay.