check if directory exists with '-d' instead of '-f'
changed mailx to $MAILX_BIN in final command
Merge pull request #1 from tschneid/master

small bugfix in sendgmail.sh