I found an example which does something like below
echo "This is the body."| mailx -s "mailx Test1" email@example.com
but i was wondering where do u configure ur mail server
and from email ??
i checked man mailx and it doesnt say if it can accept hostname as parameter