Below is my simple Sendmail script. while running, it executes without any error .. but not getting any mails in my gmail inbox.
#!/bin/bash
SUBJECT="TESTING"
EMAIL="myaddressk@gmail.com"
EMAILMESSAGE="/tmp/emailmessage.txt"
echo "This is a test mail"> $EMAILMESSAGE
# send an email using /bin/mail
/usr/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE
which sendmail do you use? did you configure it correctly? I once used postfix and had a hard time to set it up in an intranet, but I think for your purpose it should not be too hard
look here for more information: http://www.postfix.org/mailq.1.html