I want to send an email from a bash script when my script creates a new file.
This is the code I have written so far:
SUBJECT="MyNotifier"
TO="[email protected]"
echo "mail body. Something happened here.... hope you get this!" | mailx -s "$SUBJECT" "$TO"
The point is I don't get any error messsages neither mails.
I have only downloaded and instaled mailx (with the sudo apt-get command - excuse me I am noob)
I haven't configured it at all.
What am I doing wrong? Thanks in advance
echo $?and see what return value aer you getting? Also take a look in your mail log file when you run that command.