Here's a sample of the syntax on how to use it:

/usr/bin/mailx -s "the -s switch is for subject" $recipient < $msgfile