How can i use Mailx to send email

I would like to use Mailx command, please i hope when you replay give me example. because this is very good think for me.

I am New in sun Microsystems Solaris 10, i hope to give me also rules to learn Solaris easily.
Thank you
Joseph Shafik

echo "
Hi.
This is a message" | /usr/bin/mailx -s 'This is a subject' joseph@home.com

Thank you eng. Jim for your replay, but when u show my email i didn't receive any think. how can i know the message sent to my email address ?

echo "
Hi.
This is a message" | /usr/bin/mailx -s 'This is a subject' joseph@home.com me@home.com

Send a copy to yourself as well. Otherwise I don't see what you want.

I want to send email to usrname@hotmail.com ?
can i make this through Solaris.

Change the email address to username@hotmail.com

I program Solaris every day like this.... it works. What exactly does not work for you?
Do you have smtpd or sendmail or whatever mail server running? Can you see the internet? What is wrong?

I don't know any thing about smtpd or sendmail . I am new in solaris but when i try this code its working.
Thank you very much, its working. When i sent email, i received from j.shafik@unknown
How can i change unknown to be my email address
when i search they told me u can change it from DNS ????
How can i change ????

mail and mailx are Mail User Agents. MUA cannot send any mail unless there is a Mail Transfer Agent such as sendmail/postfix etc. I guess you do not have the MTA configured.

No.. i sent from mailx to my hotmail account no problem in this but wehn i recive this email
from J.shafik@unknown and this email going to spam email.
and i don't have MTA.